Сегодня я обновляю свой драйвер Chrome до
If you are using Chrome version 77, please download ChromeDriver 77.0.3865.40
Я пытаюсь найти элемент по идентификатору, используя этот код:
public static void inputValueById(String input,String id)
{
WebDriver driver2 = WebDriverMgr.getDriver();
WebElement element = driver2.findElement(By.id("//input[@id='company']"));
element.click();
element.clear();
element.sendKeys(input);
}
и получаю это исключение
ERROR: no such element: Unable to locate element: {"method":"css selector","selector":"#\/\/input\[\@id\=\'company\'\]"}
(Session info: chrome=77.0.3865.90)
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'C', ip: '10.9.26.18', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 77.0.3865.90, chrome: {chromedriverVersion: 77.0.3865.40
Может кто-нибудь посоветовать, почему поиск осуществляется по селектору css, а не по идентификатору?method ":" css selector "