Need to design a framework which support appium, selenium web driver, selenoid and winium tool

Hi All,

As we know technology changes rapidly so we need to design a framework which can handle web and mobile scripts at one place. My concern like that:

  • Framework can run web and mobile scripts parallel , For example: Login script designed for Web, Android , WAP and iOS. When we run the script by jenkins or in suite then same script would run four platform parallel by using TESTNG.

  • Framework can easily switch the driver easily form mobile to web,** For Example:** Suppose I run script on mobile and then I need to verify data from web then framework should easily switch from Appium driver to Web driver.

If any one think that any more requirement please add in the comments.

I would appreciate if we discuss our thought on the designing this type of framework.

Thanks,

2 Likes

It would be a great idea

I heard some companies developed custom frameworks with selenium + appium for their internal purpose

Hi @Chirag_Singh.
We have successfully implemented this kind of framework in our organisation.

1 Like

Hi,
Could you please share some experience/details regarding your framework. I also like to ask how you managed parallel execution for web,android,WAP and iOS.

I run by using testng and use threat count concept in testng.xml then I observed below point.
For Selenium Webdriver: It works fine.

For Appium : It override the previous session if test script does not finish. for example ( I am running two test scripts such as Login and Logout. In Appium I observed that if Login script does not finish but a new thread generates by TestNG and it overrides the previous session.
We get the result: Login script failed as session was override but Logout scripts is passed.

But same this is working fine in selenium webdriver.

So I wanna to ask can it is possible parallel execution by using TestNG in this scenario.

Thanks,

Hi.@ Chirag_Singh

To resolve issue of Appium starting a new session even though 1 st is in progress,use maxSession=1 setting in Configuration section of .json file which you might be using to start and register your grid nodes.

This setting will limit Appium sessions to 1 which will be created with any single Appium server.If TestNG thread starts any test then thread will wait till first session is over.

Thanks and Regards,
Pranoday

Hi @Pranodayd

Thanks for your reply!!

Are you using selenium grid for parallel execution. As per my understating you were saying “set maxSession=1” for selenium grid. Please correct me,If I understood incorrectly.

If I want to run parallel execution at one machine using TestNG Thread Count concept. Then how would I handle this scenarios.

For ex :
suite name =“Report” parallel=“classes” thread-count=“2”

class name = “com.testappium.web.scripts.LoginWeb”/>
class name = “com.testappium.android.scripts.LoginAndroidApp”/>
class name = “com.testappium.web.scripts.LogoutWeb”/>
class name = “com.testappium.android.scripts.LogoutAndroidApp”/>

Note: Above TestNG file just a sample but you will understand the logic.

As per above testng file, Two Thread generates at one machine and start execution. Suppose AndroidApp Login script does not complete, but TestNG fired another thread then Login Script session override by logout session.

Could you have any idea how can we handle this.

One thing more

Are you using AndroidDriver to initialize the driver as shown below:

WebDriver driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”),cap);

                                                or 

AppiumDriver as show below:

WebDriver driver = new AppiumDriver(new URL(“http://127.0.0.1:4723/wd/hub”),cap) {

				@Override
				public WebElement scrollTo(String arg0) {
					// TODO Auto-generated method stub
					return null;
				}

				@Override
				public WebElement scrollToExact(String arg0) {
					// TODO Auto-generated method stub
					return null;
				}
	};

Thanks in advance!!

Hi @Chirag_Singh.

After setting maxSession=1,even if 2nd Thread in TestNG start running,it will not invoke the test,in your case,Logout test.It will wait till your first test finishes and appium session gets closed.Use AndroidDriver to start driver instead of AppiumDriver.

Thanks and Regards,
Pranoday

Hi @Chirag_Singh and @Pranodayd guys I have also designed and is using a framework which meets the above requirements since last 1.5 yrs now

And I dropped TestNG for designing it. So then initially I had to make use of pure java code for handling each and every thing but eventually I think that decision helped me create a better and more flexible framework design.

Hi @Pranodayd,

I am still not able to understand “After setting maxSession=1” meaning here, are you using selenium grid?

Could you please explain how are we set “maxSession=1”? and where?

Thanks!!

@Chirag_Singh

Yes I am using Selenium Grid. You have to set maxSession=1 in configuration section of node.json file which you might be using to register the node with Selenium Grid Hub.

Thanks and Regards,
Pranoday