package secondpackage;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class DimensionTest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\Mitturaj.h\\Desktop\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.navigate().to("https://www.google.com/");
driver.manage().window().maximize();
List<WebElement> searchElements = driver.findElements(By.name("btnK"));
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].style.border='3px solid red'", searchElements.get(1));
}
}
Output:
No comments:
Post a Comment