Yulia
Yulia

Reputation: 1585

Selenium cursor focus on field

I'm creating tests (in Firefox) for a web app.

Depending on what field the cursor is over, a different help screen will appear. But when creating tests for those help screens, i cant get Selenium to focus on the particular field i want. I've tried using fireEvent, click, select, and type in order to get the focus to stay on the field i require in order to load that particular help screen but i've had no luck.

Does anyone have ideas on how this can be solved. Or how i can work around it?

Upvotes: 2

Views: 7317

Answers (2)

user124722
user124722

Reputation:

You can use selenium2 AdvancedUserInteractions API:

 Actions builder = new Actions(driver);
 builder.moveToElement(someElement).build().perform();

Upvotes: 1

sudarsan
sudarsan

Reputation: 283

if my understanding of your question is correct, you wanted to display different help screens for differnt elements, o.k here it is, if the message of the screen is displayed as a tool tip and the styling is taken care by mouseover event selenium.mouseOver(locator) and then [ Thread.sleep(1000) ] and then use selenium.mouseOut(locator) try with this.if you don't get it and if my understanding of your question is wrong please post it.

you must investigate how that screen is being is displayed. and try to post all that code

Upvotes: 0

Related Questions