Reputation: 17463
I am having trouble, running selenium tests for my web gui ,sometimes when the test starts the browser open but the focus is still on the eclipse(I see eclipse window rather than browser ) which then throws errors like "Button could not be found" or link not found.
Does anyone have idea how to set focus on opened browser whenever the selenium test starts ?
Upvotes: 3
Views: 3649
Reputation: 3241
It doesn't matter if the browser is focused or not. The errors most likely occur because of another circumstance.
Which Version of Selenium do you use?
If you are not already using Webdriver(Selenium 2), I would suggest switching to it.
With Webdriver 2 you can also use
windowFocus()
Upvotes: 1