Skip to main content



      Home
Home » Eclipse Projects » SWTBot » typeText switching shells(typeText switches shells during debug)
typeText switching shells [message #493551] Mon, 26 October 2009 15:20 Go to next message
Eclipse UserFriend
Has anyone else encountered a problem with typeText switching shells? I've had the problem a couple of times were I was clicking in another shell while the swtbot test was running, and suddenly that shell started receiving the entry from the typeText calls. Shouldn't typeText be setting focus to the test case's last focus prior to type of each character?

Re: typeText switching shells [message #493602 is a reply to message #493551] Tue, 27 October 2009 04:15 Go to previous messageGo to next message
Eclipse UserFriend
swtbot is always looking for the controls in the active shell. If you activate a different shell manually during a test run the swtbot test will certainly fail.
Re: typeText switching shells [message #494468 is a reply to message #493602] Fri, 30 October 2009 14:43 Go to previous messageGo to next message
Eclipse UserFriend
There seems to be some big difference in the susceptibility of typeText vs setText in this regard. I've never seen the problem with setText text ending up in a different shell. I suspect this is some flaw unique to typeText, maybe a result of the sleeps inserted between characters, where it is allowing some other shell to grab focus during and not restoring focus to the targeted widget at the start of each typed character.
Re: typeText switching shells [message #494477 is a reply to message #494468] Fri, 30 October 2009 15:30 Go to previous message
Eclipse UserFriend
Jay Norwood wrote:
> There seems to be some big difference in the susceptibility of typeText
> vs setText in this regard. I've never seen the problem with setText
> text ending up in a different shell. I suspect this is some flaw unique
> to typeText, maybe a result of the sleeps inserted between characters,
> where it is allowing some other shell to grab focus during and not
> restoring focus to the targeted widget at the start of each typed
> character.

typeText generates low level key event (unless you use the
MockKeyboardStrategy). These event are then routed to the active
(focused) widget by SWT. It is intended to mimic someone typing on a
keyboard; so if you change the focus while he types, the text will end
on the new widget.
On the other hand, setText directly sets the text attribute of the
widget; it's the same as calling Text.setText(String). Doing this, no
events are fired (such as KeyPress or Modify).

--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Previous Topic:addition to locate arrow buttons
Next Topic:Git Repo Out Of Date
Goto Forum:
  


Current Time: Thu Jun 19 17:13:08 EDT 2025

Powered by FUDForum. Page generated in 0.04522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top