答案 0 :(得分:0)
请使用您使用的代码和出现的错误来更新您的问题。也可以尝试以下代码:
WebDriverWait wait = new WebDriverWait(driver, 10);
// 1. Click to li element
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("li[data-li-id='accessories']")))
.click();
//Or 2. Click to radio button
wait.until(ExpectedConditions.elementToBeClickable(By.id("input#accessories")))
.click();
//Or 3. If radio button not visible and above code not worked, try click with javascript like below
((JavascriptExecutor)driver).executeScript("arguments[0].click()", driver.findElement(By.id("input#accessories")));
问题还可能是加载与Accessories
重叠的元素或页面未完全加载。您可以调试以检查加载问题。