0

SeleniumとAppiumを使用してAndroidで性別のドロップダウンから選択する際に問題が発生しました。私はドロップダウンリストから、ジェンダーの種類を選択するにはどうすればよいenter image description hereSeleniumとappiumを使用してアンドロイドのドロップダウンリストから選択

enter image description here

enter image description here

enter image description here

?感謝する。私のドライバー・プロバイダーとして、JavaScriptとWDで

+0

コードであなたの現在の試行を共有してください。たとえば、findElementById( "com.appzonegroup.deja ...")だけを使ってみましたか? –

+0

これはリンクです:http://stackoverflow.com/questions/41853705/select-year-on-datepicker-using-selenium-appium-and-c-sharp – kehinde

答えて

1

は、私はこのようなものを使用します。

let cmbBoxId = driver.waitForElementById("gender", '', timeOut, pollFreq); //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"; 

// U can choose 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(); 

それは私のための仕事、幸運!

関連する問題