lundi 11 novembre 2019

Two identical AutomationID using xpath python with appium

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