iOS fails to switch to PayPal web-view

Hi, is there any workaround to interact with PayPal payment window? It is displayed in my native app, I tried to access it as described in http://appium.io/docs/en/writing-running-appium/web/hybrid/ but no luck.
When I switch context, I can see web-view listed. But I can not locate elements on web-view. Did anybody have similar issue?

This works fine for me, I didn’t switch context in iOS

def paypal_login(self):
    input_email = self.driver.find_element_by_id(email_field)
    input_email.send_keys("abcd")
    input_password = self.driver.find_element_by_id(password_field)
    input_password.send_keys("123456")
    self.driver.hide_keyboard()
    click_login_button = self.driver.find_element_by_id(self.login_btn)
    click_login_button.click()
    sleep(20)
    click_agree_terms_btn = self.driver.find_element_by_id(self.agree_terms_btn)
    click_agree_terms_btn.click()
    sleep(20)

Thank you. I guess, I can locate elements without switching context. The only on bothering thing is that I can’t use appium inspector to see elements hierarchy. I will try ot experiment more using getPageSorce() and will get back to you with results

Hi,
I tried to use the approach without switching context but it doesn’t work for me. Still the same issue: no elements are recognised by appium. I will try to utilise ios debug bridge

@Venkatesh_Akula can I ask you for favour? Can you share Id’s of email_field, password_field etc. ?

ok, I got a bit closer to it. After I executed getPageSource() I could see proper html source. But I can not interact with elements due to the fact they have display = none attribute.

<input id="email" name="login_email" type="email" value="" autocomplete="off" placeholder="Email" style="display: none;">

Our locators are - Email & Password

Check if this helps:

it seems like a limitation of XCUITest driver to interact with SafariViewController.

which is described in appium documentation http://appium.io/docs/en/writing-running-appium/web/hybrid/#automating-hybrid-ios-apps