Recommendations for way to run Appium suites on different environments from a dashboard

I run my Android Appium test suites in 5 different environments (QA, PreProd, etc), with each environment having it’s own customized TestNG suite. Currently, to switch from environment A to B, I have to:
Appium Server UI- change a few settings (apk file, Package, Activity), and restart the server
Java code- change two variables in my code (defining the apk file and declaring the “ENV”). and run the appropriate TestNG suite.

I’d like to find a solution where the Manual QA Team can fire off a Test suite for any environment at any time by clicking on a button on a web page and seeing the results file when completed. Are there any recommendations on how to accomplish this task? I guess what it boils down to is launching the Appium Server with an environmental-specific configuration and firing off the environmental-specific TestNG suite with two variables configured for ENV and the APK. Can the first part be accomplished by starting Appium via command line and passing appropriate parameters?

My current setup is:
Appium Server 1.5.3
Java client 4.1.2
Maven project
TestNG 6.9.10
Server that will be used is a Mac Mini (OS 10.11)

Some tools that are used in-house for other projects include Bamboo, Docker, RunDeck.
Thanks for any ideas….

You can either start Appium via command line or directly through code using AppiumDriverLocalService and pass the parameters.

public class AppiumServerSetup {
	
	private AppiumDriverLocalService appiumDriverLocalService;
	private AppiumServiceBuilder appiumServiceBuilder;
	private DesiredCapabilities desiredCapabilities;
	
	private void instantiateAppiumServer() {
		desiredCapabilities = new DesiredCapabilities();
		desiredCapabilities.setCapability("noReset", "false");
		    		
		//Build the Appium service
		appiumServiceBuilder = new AppiumServiceBuilder();
		appiumServiceBuilder.withIPAddress("127.0.0.1");
		appiumServiceBuilder.usingPort(4723);
		appiumServiceBuilder.withCapabilities(desiredCapabilities);
		
		//Instantiate the Appium Server with the Service Builder
		appiumDriverLocalService = AppiumDriverLocalService.buildService(appiumServiceBuilder);
	}

	public void startAppiumServer() {
		instantiateAppiumServer();
		appiumDriverLocalService.start();
	}
	
	public void stopAppiumServer() {
		appiumDriverLocalService.stop();
	}
}
1 Like