【发布时间】:2017-06-09 09:31:17
【问题描述】:
【问题讨论】:
-
请分享您当前的代码尝试。例如,您是否尝试过仅使用 findElementById("com.appzonegroup.deja...") ?
标签: android selenium-webdriver drop-down-menu appium android-uiautomator
【问题讨论】:
标签: android selenium-webdriver drop-down-menu appium android-uiautomator
使用 javascript 和 wd 作为我的驱动程序提供程序,我使用这样的东西:
let cmbBoxId = driver.waitForElementById("gender", '', timeOut, pollFreq);
// note: Without the com.appzonegroup.dejavuandroid.zoneRevamp:id/
// Clicking the dropDown to open the listView
cmbBoxId.click();
let optionPath = "//android.widget.TextView[@resource-id='" +
"com.appzonegroup.dejavuandroid.zoneRevamp:id/spinner_item";
// You can choose to look for the option by index or text
// By Index of the desired option
// optionPath += " and @index='" + "1" + "'";
// **OR**
// By Text of the desired option
// optionPath += " and @text='" + "Female" + "'";
optionPath += "]";
//Clicking the desired option
driver.waitForElementByXPath(optionPath, '', timeOut, pollFreq).click();
祝你好运!
【讨论】: