简体   繁体   中英

Running selenium scripts( jar files) on remote computers

I have a selenium script written in Java. I exported it as a .jar file to my system and I can run that from my command line. But I need to send this across my team. The problem with the script is the task requires to get files from my computer using the file path and it need to do some conversion and save it back to a particular folder. I have written code with all the file paths for my computer. How can that run in another remote computer? Is there any way to do that? Also when i give the chromedriver path in my script it wont work on remote computer because they save chromedriver in different file location.

I tried using parameter but problem is it is a time consuming process. It would be great if some one can edit the jar file as a one time process. I used tools to open Jar file but the code is not seen it displays symbols.

You can try keeping all the required files (your files in your computer, chromedriver, etc) in the same folder as the jar that you are executing. This way, you can reference all the required files using a relative path, instead of an absolute one, ie ./your_required_file.txt

So, you can send the whole directory to your team to execute it.

That being said, I honestly recommend that you take some time on reading up on Java and Selenium's documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM