середа, 4 лютого 2015 р.

WebDriver: JS execution

In reality, with WebDriver not all the events can be automated. So we can use JavaScript to simulate the click on  the button



@Test
public void test() throws Exception {

if (driver instanceof JavascriptExecutor) {

((JavascriptExecutor) driver).executeScript("document.getElementsByClassName('children')[0].getElementsByTagName('a')[0].click()");

}
}


Немає коментарів:

Дописати коментар