Running code on remote server (container)

27 views
Skip to first unread message

sdemp

unread,
Jun 13, 2018, 10:37:35 PM6/13/18
to Selenium Users
Hi,

I am currently using Selenium to automate the input of 1000's of lines of test data every day.  I have selenium grid running in a docker container and I have multiple chrome nodes running too.  The test data is being compiled into spreadsheets and I am running the code (written in java) on my machine from the IDE.  Each batch takes about 4 hours to complete.

What I would like to do is move this code onto a remote server in a docker container.  I want normal users to be able to upload their spreadsheets and start the code themselves rather than depend on me to do it.  I also want them to be able to leave the code running on the container and not have to worry about it running on their local machine.

I'm looking for some advice on the best approach to achieve this.  Should I be rewriting everything in PHP or nodeJS that can easily run on a web server or is there an easy way to run a complied version of the Java that I have already written with a front end that would allow users to upload the spreadsheet?  I have looked into Jenkins but nearly everything I have read is assuming that a testing framework is being used.

Thanks

David

unread,
Jun 14, 2018, 5:32:47 PM6/14/18
to Selenium Users
So you have custom Java code that doesn't use a test framework? You should ensure your code can compile into a JAR file that is command line executable. Otherwise, the alternative approach is Java (servlet) code that runs on web server, which depending on what you do, can be a trivial or daunting task.

You could craft a simple web UI that handles file uploads and invokes a shell execute against the JAR with the uploaded spreadsheet(s) as arguments. This you could do in any choice of language. You can track progress or manage the execution by perhaps forking off the execute so it's not blocking to the web request/server, and log down the process ID of the running JAR for checking status or killing it if needed when hung. Other status could be logging/redirecting the JAR's stdout to file and simply be able to present that file data in web UI for status progression.

Rewriting everything including that Java code logic is likely a lot of work unless your program is simple. Best to either adapt the Java code for Java web framework executability or integrate it with another web framework using shell execute of the JAR.
Reply all
Reply to author
Forward
0 new messages