Add supported app at runtime in Selendroid

159 views Asked by At

I'm using the code as from the Selendroid quickstart tutorial (pasted below) to launch the selendroid-standalone application.

SelendroidConfiguration config = new SelendroidConfiguration();
// Add the selendroid-test-app to the standalone server
config.addSupportedApp("src/main/resources/selendroid-test-app-0.15.0.apk");
selendroidServer = new SelendroidLauncher(config);
selendroidServer.launchSelendroid();

Now, since I want to test multiple applications which I don't know a priori, I'd like to leave the standalone executing and adding new supported applications at runtime. I could not find anything related to this in the documentation, except from a command-line option -folder which is said to specify a directory to monitor for new .apk files to sign and support.

It is close to what I want, but not exactly. I'd like to be able to individually pick supported apps to add via Java APIs to the standalone. I'd rather avoid havin to create a folder and copy the .apk in there from the code. Can I keep invoking config.addSupportedApp even after the selendroidServer has been launched, in example? I could not find any proper documentation for that method.

1

There are 1 answers

1
Sandeep Singh On

It is actually not possible to add apps at the runtime to the selendroid server. One thing you can do though is that you can stop the current server instance and then start the new server right from your code. You can try to implement that. This is all I can suggest as an alternative.