strong textIm Trying to test an app on iOS, and I’m trying to find elements by XPATH I’m supposed to enable a click to Create Account hyperlink, while I’m trying to find the element by path using name as attribute I’m getting an error , here’s the error file and script
Appium : 1.6.4
iOS Version : 10.3
Script: CreateAccount = self.driver.find_element_by_xpath(’//XCUIElementTypeApplication[@name=“Payload”]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton(a[@id=“Create Account”])’) #Actions element = CreateAccount element.click()
Error: Traceback (most recent call last): File “test_a2.py”, line 41, in test_a2 CreateAccount = self.driver.find_element_by_id(’//XCUIElementTypeApplication[@name=“Payload”]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton(a[@id=“Create Account”])’) File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 271, in find_element_by_id return self.find_element(by=By.ID, value=id_) File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 756, in find_element ‘value’: value})[‘value’] File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 238, in execute self.error_handler.check_response(response) File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/appium/webdriver/errorhandler.py”, line 29, in check_response raise wde NoSuchElementException: Message: An element could not be located on the page using the given search parameters.