Search code examples
mobileautomated-testsappiumwebautomation

What is the best approach for a testing framework which supports web and mobile testing?


Currently I have a Web testing framework implemented with Selenium + Java + testNg. I am to improve it to support mobile testing (Iphone + Android). My initial thought was using Appium + Java+ testNg for mobile and creating separate projects (one for each environment - Web, Mobile and Iphone). But I am not pretty sure if it is the best solution.

Is it possible use the same project for Mobile (Android + Iphone) in order to reuse the Page Objects?

PS: The target product is a website which is launched on browsers.


Solution

  • The solution that you are looking for is so complex but it is not impossible .

    I haven't done any automation for iOS sorry about that can't help you for iOS.

    In past i have worked on project basically an automation for Android application, but for some cases test cases needs an master data which is handled by the web application so i need to switch from android test script to web test for getting and setting the master data for android app, i am able to do it but took so much time to developed the logic but in the end the solution worked for me I have used the same technologies as you are Selenium(Java) + TestNG

    The project that i had developed based on Data Driven Framework used dependency so i am able to switch between android to web by using master data and also developed logic in Driver class which handles the starting workflow of the test scripts.

    In your case, If the functionality is same in the web and android app so one project will able to handle both android and web test scripts but need to developed that complex logic this will be the best solution instead of write the same code again and again

    If the functionality is totally different then you have no options you have to make two different projects one for web and one for android.

    I hope you understand it well .