Forum Discussion
From what I understand what you're trying to test is an 'application feature'.
" The test goal is to verify that when one user is doing an specific action on that page (seting a textbox for instance), another user can't do the action (setting the same textbox) because the application blocks some actions when some user is doing it."
Couldn't you do this by opening 2 different browsers and doing the same activity? I don't see how using the same or different browser changes any test results but your life will be much easier by using 2 different browsers.
e.g. firefox and ie.
You can always switch browsers and re test to add another test case.
I raised a ticket with Smartbear about this.
With multiple browsers, focus and "bringing to front", has not been handled properly in Chrome (not sure about other browsers) since they stopped using the NPAPI plugin.
They recreated the problem and it should be fixed in the next release.
I'm using Chrome and my current workaround is to find the BrowserWindow object with the correct caption (mine are all different) and then apply the "Activate" method to that BrowserWindow. This activates the right browser for me and focus is correct. Not ideal, but it will work for me until they fix it.
Which browser are you using?
- baxatob9 years agoCommunity Hero
Hi Colin,
Thanks for replay.
I am using IE 11 and FireFox 38.
- Colin_McCrae9 years agoCommunity Hero
lol
Of course. The two I don't use! :smileylol:
Have you tried using "Activate" rather than "SetFocus"? (Assuming they support this method ...)
I found SetFocus didn't work for me. Hence my use of Activate instead.
- AlexKaras9 years agoChampion Level 3
Hi,
Activate() and SetFocus() are different things. SetFocus() just sets the keyboard input focus to the given control while Activate() makes the window active and puts it in the front of all other windows. The above means that: a) Not all windows can be activated (e.g. MDI ones usually cannot); and b) the OnUnexpectedWindow() event is triggered if the given window cannot be activated (e.g. if it is blocked by some modal window). Note, that the OnUnexpectedWindow() event is not triggered if SetFocus fails to set the focus to the target control. The above makes it a standard coding practice (for desktop applications) to call Activate() at the proper places to ensure that no modal (usually - error or warning) windows are displayed.
The function from http://community.smartbear.com/t5/Functional-Web-Testing/How-to-match-a-Page-object-to-its-BrowserWindow/m-p/85701#M19988 worked fine for me for all windows-supported browsers (except Edge which I just did not check). However the referenced function relies on the caption of the target window...
Related Content
Recent Discussions
- 3 days agovladd1