Код:
Код: Выделить всё
package test;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class test1 {
public static void main(String[] args) {
test();
}
public static void test() {
System.getProperty("WebDriver.chrome.driver");
WebDriver driver = new ChromeDriver();
//go to google.com
driver.get("https://www.google.com");
//enter text in search box
driver.findElement(By.name("q")).sendKeys("Automation step by step");
//click on search button
driver.findElement(By.name("btnK")).click();
//close browser
driver.close();`your text`
System.out.println("Test completed");
}
}
Код: Выделить всё
Oct 30, 2024 9:49:24 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 130, returning the closest version; found: 129; Please update to a Selenium version that supports CDP version 130
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: element not interactable
Подробнее здесь: https://stackoverflow.com/questions/791 ... st-version