Вот аргументы, которые я устанавливаю для chromeDriver
Код: Выделить всё
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless=new"); // Run in headless mode
options.addArguments("--disable-gpu"); // Applicable to Windows machines
options.addArguments("--no-sandbox"); // Bypass OS security model
options.addArguments("--window-size=1920,1080"); // Set window size
options.addArguments("--disable-application-cache");
options.addArguments("--ignore-certificate-errors");
options.addArguments("--start-maximized");
options.addArguments("--enable-javascript");
driver = new ChromeDriver(options);
Код: Выделить всё
WebElement nextButton = driver.findElement(By.xpath("//*[@id='next-btn' or @title='Next']"));
(JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", nextButton);
((JavascriptExecutor) driver).executeScript("arguments[0].click();", nextButton)
// Dispatch the 'input' event to simulate user interaction
((JavascriptExecutor) driver).executeScript("var event = new Event('input', { bubbles: true }); arguments[0].dispatchEvent(event);", nextButton);
System.out.println("Button clicked");
wait.until(ExpectedConditions.urlContains("https://myidppage.com"));
Пожалуйста, помогите мне понять, что происходит
Подробнее здесь: https://stackoverflow.com/questions/790 ... s-expected
Мобильная версия