1. WebElement element =driver.findElement(By.id("idElement"));
((JavascriptExecutor) driver).executeScript("return arguments[0].getText();", element);
2. WebElement element =driver.findElement(By.id("idElement"));
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", element);
3 WebElement element =driver.findElement(By.id("idElement"));
javascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("document.getElementsByName('body')[0].setAttribute('type', 'text');");
element .clear();
element .sendKeys("text");
No comments:
Post a Comment