iPhone safari takes more time to execute the same script than Android chrome

I am automating the Mobile web browser on Android and iOS devices.

I am using Page Object model Framework using Java + Appium.

Wrote same script for Chrome and Safari browser.

But Safari takes more time than chrome browser.

For example:

  • Login scripts takes 5 minutes to finish on Android Chrome.
  • Login scripts take 40 minutes to finish on iPhone safari browser.

Even it takes 5 to 10 seconds to perform any kind of manipulation while working iOs devices.

Thank you

I dont have a super clear answer for you because I have always had problems with iOS being way slower than Android. I do have a couple of suggestions though… Check your Appium version and Java Selenium version… iOS became very slow after upgrading to Appium 1.8 but then I got my speed back when I also upgraded Java-Selenium… here is a post about it

Also, in my experience, iOS has a hard time with xPath… using CSS names to find elements has made things faster…

I also got some speed by not using selenium’s implicitlyWait when running on iOS… Im having trouble finding the post where I learned that

I hope that helps a little… Good Luck!

Thank you so much…
Now after updating Appium java client (6.0.0-BETA5) and Selenium-java (3.9.1) it is executing faster.

But I am facing issue after updating these dependencies.

org.openqa.selenium.WebDriverException: Returned value cannot be converted to WebElement: {stacktrace=NoSuchElementError: An element could not be located on the page using the given search parameters.

I have also filed issue for appium on Github.

If you have any solution please share.

Thank once again.

If you could attach your full Appium logs from the run, I might be able to help you. “Returned value cannot be converted to WebElement” is an very common error that happens under quite a few conditions. You could have the current context set to NATIVE when you are trying to select an element in the WebView… the element could be hidden or not ready when you make the selection… your selector could be wrong… etc

When I updated Selenium-java, I ran into a few extra trivial issues that werent there before

Hi Smitty,

Yes, I am getting Returned value cannot be converted to WebElement: this issue due the element is not currently on page.

So I have updated the locators.

Thank you so much for your help.

Happy Testing :slight_smile:

Happy to help and glad to hear you are making progress.