Unable to locate element: {“method”:“xpath”,“selector”:“//li[@id=”tablist1-tab3“]”} error using Selenium and Java
问题 I have received this error for several times: Unable to locate element: {"method":"xpath","selector":"//li[@id="tablist1-tab3"]"} Code that I have used is: options.addArguments("--headless"); options.addArguments("window-size=1200x900"); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); WebElement tab = driver.findElement(By.xpath("//li[@id=\"tablist1-tab3\"]")); tab.click(); Can someone help me with this error? 回答1: You need to use WebDriverWait for the elementToBeClickable()