0

I am new to using Selenium with Appium for mobile testing. We have used selenium web driver to automate our website and looking to move towards automation of the mobile app.

I am hoping I could reach out for a few quick pointers. I am not able to select this element to then send text to begin the log-in process and I have been researching for hours to find a possible video help etc.

Below is a screen shot from Appium, I am trying to select the email field and I cant see to use the ID or the xpath: https://screencast.com/t/KokZ2tCgjLG4

I am looking to find the element and then sendkeys to the field so I can log into the app.

Here is my code:

def setUp(self):
desired_caps = {}
desired_caps[‘platformName’] = 'Android’
desired_caps[‘platformVersion’] = ‘8.0’
desired_caps[‘deviceName’] = ‘Pixel’
desired_caps[‘app’] = PATH(
’/Users/stevenrutherford/desktop/Android/foodlogiq-x86.apk’
)
desired_caps[‘appPackage’] = 'com.foodlogiq.connect’
desired_caps[‘appActivity’] = ‘.MainActivity’

    self.driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)


def test_login(self):
    time.sleep(15)

    email = self.driver.find_element_by_xpath("//*[@contentDescription='EMAIL ']") #I have try multiple options here
    email.click()

And I can’t seem to get Appium to find the element:

[HTTP] --> POST /wd/hub/session/a56058ad-94e9-4a69-a554-ad7bc3d2b6b7/element {“using”:“xpath”,“sessionId”:“a56058ad-94e9-4a69-a554-ad7bc3d2b6b7”,“value”:"//[@contentDescription='EMAIL ']"}
[MJSONWP] Calling AppiumDriver.findElement() with args: [“xpath”,"//[@contentDescription='EMAIL ']",“a56058ad-94e9-4a69-a554-ad7bc3d2b6b7”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//[@contentDescription='EMAIL ']",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//[@contentDescription='EMAIL ']",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[@contentDescription='EMAIL ‘]’ using ‘XPATH’ with the contextId: ‘’ multiple: false

It sits at this point without clicking the element or moving forward to even attempt to enter the email address.

Eugene S
  • 6,709
  • 8
  • 57
  • 91

0 Answers0