3

I have already created automated test cases using selenium and java for desktop web testing. Is there a way for me to run the same tests on my personal mobile? Searching on google I find resources linking to native app testing and mobile tests for devices that are hosted on cloud. If you can point me to a resource or tool that would be very helpful!

1

The best available tool is Appium.

It meets the requirements for the mobile testing services as it is open-source, and a cross-platform test automation tool used to automate native, hybrid, and mobile web apps for iOS and Android devices.

In your scenario, the test cases automated for the web application can only be executed directly on the mobile web browser provided that in the mobile-web view -> the element's locators, functionality flow and UI elements remain same as that in desktop web app view

Moreover, if functionality flow/UI elements are same in both mobile-web/desktop-web view then, the following approach can be used to accomplish your goal:

  • Add the locators for the mobile web app to the automation framework
  • Add a variable to assign execution platform : Web Or mobile
  • Then configure automation scripts to pick the respective locators at run time depending upon the platform being executed
| improve this answer | |
0

If you have the tests for desktop version of an app then you will likely be not able to execute the same for mobile version of an app since when a server detects that you are using mobile browser it sends a mobile version of a page to the client.

Normally such page has different layout and classes so that your locators won't be working.

| improve this answer | |
  • I am doing this for learning purposes and the webpage has some elements with unique Ids assigned to them. I don't get it why the locators won't work because the same page will load on mobile as well so layout maybe different but the elements will still retain their id attributes or won't they? – Rohit May 6 at 11:40
  • Not necessarily. This depends on how your application is implemented. Normally mobile sites have very simplified structure. There might be the case when some the UI controls are missing (because of the difference user experience with mobile device) so having even id attribute would not help much to port the cases. Probably to get more specific answer you should come up with more details. Like:"I have this page on my desktop site and this page when open it up on my mobile device. And here is my representative piece of automation code. How do I port this to appium framework or alternatives?". – Alexey R. May 6 at 11:50
0

By far the easiest way to do mobile testing is testRigor. You can just specify the home URL and write steps in English like:

click "My Product"
click "Add to Cart"
enter "4111111111111111" into "card"
click "Place Order"
check that page contains "order successful"

Disclaimer: I'm a co-founder of testRigor.

| improve this answer | |
0

Mobile testing is more intricate than web testing. But, you can make life easier by using a dedicated tool. There are many mobile automated testing tools. I am pointing some of them that would be helpful for you.

Appium is compatible with all modern programming languages, supports automation across a variety of platforms, and automates all types of applications.

A few other similar tools are Calabash, UI Automator, Robotium, SeeTest, TestComplete, and TOSCA. There are pros and cons for each that we should check thoroughly.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.