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!
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
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.
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.
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.