Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
182 views
by Contributing Tester (14 points)
HI,

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.

1 Answer

0 like 0 dislike
by
selected by
 
Best answer
Usually, you can do this by creating resource folder in the same directory where your .jar file is. Now you can use relative path and pick each file and store files back to the resources folder. Same goes for chromedriver. You can keep all your mandatory files inside that resources folder and distribute folder as well with your JAR file. This way it can be made generic, instead of making it computer specific.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...