In in our mobile app, there are two boxes with the same AutomationId. For automated testing i need to find the first of the two elements by xpath. I tried following code, bt it didn't work:
self.driver.find_element_by_xpath(
"xpath=(//[@contentDescription='Cards'])[1]").click()
time.sleep(0.5)
self.assertEqual('Angle x:',
self.driver.find_element_by_accessibility_id('MovementsTitle').text)
time.sleep(0.5)
Thanks!
Aucun commentaire:
Enregistrer un commentaire