如果我的問題聽起來很重要,我很抱歉,我在QA和Selenium方面很新。「ExpectedConditions.visibilityOfElementLocated」和「ExpectedConditions.presenceOfElementLocated」之間的確切區別是什麼
之間有什麼準確的區別:
wait.until(ExpectedConditions.visibilityOfElementLocated
(By.xpath("//a[text()='Show advanced settings...']"))).click();
和
wait.until(ExpectedConditions.presenceOfElementLocated
(By.xpath("//a[text()='Show advanced settings...']"))).click();
我看了一下here但沒弄明白。
因此,如果一個元素存在,但不可見,我們不能點擊它,但如果它是可見的,並現在我們可以做到,對吧? – LoveLovelyJava
正確。除非你使用JavaScript點擊。 –
javascript click?我需要用JavaScript編寫代碼嗎?! :( – LoveLovelyJava