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!
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.
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
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.
With the mobile market becoming more prominent year after year, it is important to ensure that your website renders perfectly on mobile devices and that it gives users a flawless digital experience.
An easy way of ensuring your website performs well across multiple mobile platforms is through test automation. Test automation using frameworks like XCUITest, Apium, or Espresso allows you to create and execute mobile test cases with ease.
Since Apium relies on a RemoteWebDriver, you will need to set it up. The RemoteWebDriver facilitates remote connection to the cloud or a testing lab with multiple devices.
Here is an example showing how to configure your RemoteWebDriver against the desired test capabilities.
String host = "mymobilecloud.perfectomobile.com";
URL url = new URL("https://" + host + "/nexperience/perfectomobile/wd/hub");
RemoteWebDriver driver = new RemoteWebDriver(url, capabilities);
After setting up the RemoteWebDriver, you can proceed to running the tests and validating your website.