input class =“ dxeEditArea dxeEditAreaSys” name =“ ctl00 $ MainContent $ ddlApprover” value =“ ALEXANDER MANIQUIZ(FSO.PHI.FPHI.HR)” id =“ MainContent_ddlApprover_I” onchange =“ aspxETextChanged('MainContent_ddlApprover')” onblur =“ aspxELostFocus('MainContent_ddlApprover')” onfocus =“ aspxEGotFocus('MainContent_ddlApprover')” type =“ text” onkeydown =“ aspxEKeyDown('MainContent_ddlApprover',event)” style =“” autocomplete =“ off” readonly =“” xpath =“ 1”
class =“ dxeListBoxItem” id =“ MainContent_ddlApprover_DDD_L_LBI4T0” xpath =“ 1”>丽塔(Rieta Ed Brian)Tabaqua(FSO.PHI.FPHI.CEBU)
我的代码。
driver.findElement(By.xpath(“ // input [@ id ='MainContent_ddlApprover_I']”))。click(); 列表选项= driver.findElements(By.xpath(“ // input [@ id ='MainContent_ddlApprover_I']”)))
for(WebElement option : options)
{
if(option.getText().equalsIgnoreCase("Rieta Ed Brian Tabaqua (FSO.PHI.FPHI.CEBU)"))
{
option.click();
}