inderpreet kaur
inderpreet kaur

Reputation: 55

how can i select the time in appium

enter image description herethis image show the ui of the elements in the circle

I am trying the

  1. driver.findElement(By.xpath("//android.widget.TextView[@text='5']"));

  2. driver.findElement(By.xpath("//android.widget.RadialTimePickerView$RadialPickerTouchHelper[@content-desc='5']"));

  3. driver.findElement(By.xpath("//android.widget.RadialTimePickerView$RadialPickerTouchHelper[@content-desc='5']")).click();

Upvotes: 0

Views: 966

Answers (2)

inderpreet kaur
inderpreet kaur

Reputation: 55

driver.findElementByAndroidUIAutomator("UiSelector().className(\"android.widget.RadialTimePickerView$RadialPickerTouchHelper\").instance(2)").click(); Thread.sleep(5000); driver.findElementByAndroidUIAutomator("UiSelector().className(\"android.widget.RadialTimePickerView$RadialPickerTouchHelper\").instance(1)").click();

First link for hour and second for minute for hour: instance 0 means select the 1 hr from watch and instance 1 for select the 2 hr from watch and so on........ for min.:- instance 0 means select the 00 min from watch and instance 1 for select the 0 5min from watch and so on..........

Upvotes: 0

Anuja
Anuja

Reputation: 115

You can identify the element using classname, store it in a List and access it using either its index or some attribute.

List <WebElement> allElements = driver.findElements(By.classname("android.widget.RadialTimePickerView$RadialPickerTouchHelper"))

After this, iterate the list and perform the action

Upvotes: 2

Related Questions