[英]Instance of WebDriverWait method doesn't generates Template Proposals in Eclipse as before
我有一個小程序,應該單擊某些內容然后等待。 不知何故,在輸入點並等待后,我現在沒有像以前那樣得到建議(代碼完成)。
這是程序的一小部分:
driver.findElement(By.id(StartRenderedButton)).click();
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.unt
這些進口我做了:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
沒有任何建議。
我嘗試安裝新的IDE,嘗試在編輯器上進行更改>高級,但沒有任何幫助。
我如何找回它?
首先,要打開/確保已在Eclipse IDE上啟用自動建議,請轉到
窗口>首選項> Java>編輯器>內容輔助>自動激活部分
並確保您具有以下設置:
0
.
專家提示:如果要在獲取“。”時彈出所有字母的自動建議,請在Java的自動激活觸發器中輸入“ .abcdefghijklmnopqrstuvwxy
”。
其次,您需要一個WebElement引用來使用顯式wait [= wait.until ...],例如,
WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")
資料來源: seleniumhq -docs
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.