LoveJavaTwo February 2016

double click does not work for a changing web element

I am using Selenium and Java to write a test. I need to double click on a web element so I use:

action.doubleClick(webelement).build().perform();

but the problem is that while double-clicking the element changes, in other words, when you click on the element, it becomes highlighted, so when you double click, it gets highlighted and unhighlighted causing me to the stale web element error.

My solution was:

action.moveToElement(webelement).doubleClick().click().build().perform();

is this fine or are there any better way to handle this issue?

Answers


Pratyush08 February 2016

@LoveJavaTwo U can try POM approach and because of POM object stale problem resolved. So try this approach or use method in same class if you don't wanna use POM.

Hope this will resolve your problem.

Because on my machine with POM approche this code works fine.

Post Status

Asked in February 2016
Viewed 2,019 times
Voted 5
Answered 1 times

Search




Leave an answer