0

I'm starting to get frustrated with Chrome emulator: Using JAVA + Selenium + TestNG I'm testing many of our web applications which runs on few browsers. On mobile browser we have a special design - and NOW i'm trying to test it with the Chrome emulator but without great success. I can only load a page and check the elements, BUT I CAN'T click() on it (or other interactions with Actions object).

I've tried a simple :

someElement.click()

and

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

and both doesn't work. The run just stays there until the test case gets time out.

Any ideas? Thanks

  • Check Prabu's Answer from here And if that doesn't work, paste the Exception you're getting. – user9413725 Mar 22 '18 at 6:53
  • Thanks, I already tried most of the ideas in the link you provided (I even start with scrolling to the element I'm testing in each test (using JS- window.scrollBy() ). I do not get any exception, the test just wait until timeout. – Yair Mar 24 '18 at 17:50
0

Have you tried JavascriptExecutor already? Somtimes I also have the same problem when WebDriver click() and Actions don't work, then most of the time, JavascriptExecutor will do.

JavascriptExecutor js = (JavascriptExecutor) webDriver;
js.executeScript("arguments[0].click();", someElement);

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.