コードでメソッドを使用しようとしましたselect()
が、Eclipse でエラーが表示されます。select()
Seleniumの組み込みメソッドですか? 理解できません。
select(driver2.findElement(By.xpath("//*@id='webLossReport.contact.address.state']")),index=i);
Eclipseは"The method select(WebElement, int) is undefined for the type entry"
、このクラスでメソッドを作成するオプションを提供しています。
他の方の使い方を教えてください。私の要件は、「インデックス番号に基づいてリスト値を選択する」ことです
更新: リクエストに応じて投稿されたコード、
WebElement LSD = driver2.findElement(By.xpath("//select[@id='webLossReport.lossInformation.locationOfLoss.state']"));
List <WebElement> LLS = LossStateDropdown.findElements(By.tagName("option"));
int i= LLS.size();
select(driver2.findElement(By.xpath("//*@id='webLossReport.contact.address.state']")),index=i);