[英]org.openqa.selenium.NoSuchElementException even when the element is present
[英]Selenium WebDriver - Getting NoSuchElementException error even element is present
我試圖單擊應用程序中的下拉框,而Xpath是: //*[@id='sel2O5_chzn']/a
但是,當我嘗試單擊它時,應用程序中出現NoSuchElementException Even元素。 在IE中嘗試過,Chrome和Firefox仍然面臨相同的問題
driver.findElement(By.xpath("//*[@id='sel2T1_chzn']/a")).click();
也嘗試過以下方式,但沒有運氣。 獲取相同的NoSuchElementException
Select sel = new Select(driver.findElement(By.xpath("//*[@id='sel2T1_chzn']")));
sel.selectByIndex(1);
請幫助我解決這個問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.