# iOS fails to switch to PayPal web-view

**URL:** <https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685>\
**Category:** Support\
**Created:** [January 26, 2018, 5:34pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685 "2018-01-26T17:34:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [January 26, 2018, 5:34pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/1 "2018-01-26T17:34:59Z")

</div>

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/](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?

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Akula](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh_akula/32/7260_2.png) [@Venkatesh\_Akula](https://discuss.appium.io/u/Venkatesh_Akula)\
**Post date:** [January 27, 2018, 12:14pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/2 "2018-01-27T12:14:48Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [January 28, 2018, 7:20pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/3 "2018-01-28T19:20:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [February 6, 2018, 3:56pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/4 "2018-02-06T15:56:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [February 6, 2018, 6:37pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/5 "2018-02-06T18:37:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [February 7, 2018, 8:29pm UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/6 "2018-02-07T20:29:59Z")

</div>

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;">`

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Akula](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh_akula/32/7260_2.png) [@Venkatesh\_Akula](https://discuss.appium.io/u/Venkatesh_Akula)\
**Post date:** [February 8, 2018, 2:35am UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/7 "2018-02-08T02:35:11Z")

</div>

Our locators are - Email & Password

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Akula](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh_akula/32/7260_2.png) [@Venkatesh\_Akula](https://discuss.appium.io/u/Venkatesh_Akula)\
**Post date:** [February 8, 2018, 2:36am UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/8 "2018-02-08T02:36:46Z")

</div>

Check if this helps:

> <https://stackoverflow.com/questions/26958193/how-to-select-any-element-from-the-web-element-with-display-none-attribute-us>

---

<div class="post-metadata">

**Author:** ![olyv](https://discuss.appium.io/user_avatar/discuss.appium.io/olyv/32/5475_2.png) [@olyv](https://discuss.appium.io/u/olyv)\
**Post date:** [May 9, 2018, 9:15am UTC](https://discuss.appium.io/t/ios-fails-to-switch-to-paypal-web-view/20685/9 "2018-05-09T09:15:02Z")

</div>

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](http://appium.io/docs/en/writing-running-appium/web/hybrid/#automating-hybrid-ios-apps)
