Hi Avinash!
The code I posted was all I had to do. I’m interacting with hockey app, which launches the chrome app initially, then I use
def _web_app(self, username, password):
try:
self.web_driver.start_activity('com.android.chrome', 'com.google.android.apps.chrome.Main')
_log.info("switched to chrome")
sleep(5)
information = self.web_driver.find_element_by_xpath("//*[@text='INFORMATION']").is_enabled()
if not information:
_log.info("need to log in")
self.web_driver.find_element_by_xpath("//*[@text='Email']").send_keys(username)
self.web_driver.find_element_by_xpath("//*[@text='Password']").send_keys(password)
self.web_driver.find_element_by_xpath("//*[@text='Sign In']").click()
sleep(5)
_log.info("clicking authorize")
self.web_driver.find_element_by_xpath("//*[@text='Authorize']").click()
_log.debug("clicked authorize")
return True
except NoSuchElementException:
_log.error("No element found for login")
return False
I found Chrome’s package and Name through some quick googling, though you can always do a dumpsys
Note, I am using Android. If I get ios working I will give an update