Not able to click on "google login" and "FB login" in ios browser application


I am testing a mobile website in IOS through appium automation. In login scenario, I am trying to login through google login or facebook login, but I am unable to click on those button. I have tried with different xpath, but it is not working.

I am using python and appium for automation.

You are going to give us a bit more information. Have you tried debugging with a sleep/wait before clicking? Just checking if it’s not going to fast.

Can you show us some code and share the versions you are using? Perhaps an example? :slight_smile:

1 Like

Hi Yashi, Welcome.
I assume you are trying to automate a Safari browser, or an embedded browser? I’m a bit new to the iOS and Appium side myself, but without a screenshot or a actual xpath query, not able to help much.

I am using Python too, but most of us will be using Java, any code sample will do though. Please do not be afraid to share a screenshot, but be aware we cannot guarantee it will not give away any secrets. This needs to be a place we can ask questions about stuff in beta sometimes, we know it’s hard.

Hi @kristof,

I have tried giving time.sleep(5) …but it is not working.

Appium version: 1.15.1
mobile: iphone 7 plus(12.3.1)
python : 3.7

code example:

element= driver.find_element_by_xpath("//abc")

Does clicking other buttons work? => Can you try clicking on a button on a different app?
You mention you “have tried with different xpath” => What do you mean with " different xpath" ?

Do you have an example of a public app where your issue also appears?

EDIT: What is the specific error that you are getting?

Hi @conrad.braam,

Yes, I am trying to automate safari browser. But it is working fine in android.

I have mentioned the code example in above reply.


It would be good for you to simply share the XML returned by

maybe just remove and keep only the xml for the bits that are relevant if you want to isolate.

Yes , I am able to click on other button. I am testing same website in android browser also but it working fine in android, not working in IOS only.

“Different xpath” means tried giving id, xpath, in xpath tried with giving parent class name and all.

I am not getting any error, the step is passing but there is no click action happened.

Here is some hierarchy of google login element (it is not exact, i have edited it somewhat) :

div class=“otp_social”>
div class=“otp_social_login popup” =“showLESocialPopup('…9e1f&scope=email%2Cuser_birthday’,500, 400)">
.com/skin/frontend/default//images/social/fb.svg?v=1565340641" alt=“Facebook”>
div class=“otp_social_login popup” onclick="showLESocialPopup('htps://
.com%2Fgoogleconnect%2Findex%2Fconnect%2…’,500, 400)">
.com/skin/frontend/default/*/images/social/google.svg?v=1565340641” alt=“Google”>

I have tried with below xpaths:

  1. //span[contains(text(),‘GOOGLE’)]
  2. //span[contains(text(),‘FACEBOOK’)]
  3. (//div[@class=‘otp_social_login popup’])[1]
  4. (//div[@class=‘otp_social_login popup’])[2]
  5. //div[@class=‘otp_social’]//div[@class=‘otp_social_login popup’]