0

I'm new here and want to share my experience with you. Till now I didn't have any experience in running my Selenium Java automation script on a server, but now I have a problem: I cannot find more information on how to run the script before every deployment.

I'm using TestNG, Maven, Selenium Webdriver, Java. POM, builder pattern. Generally, I want to implement multiple browser testing and handle photo upload. Also, because I`m not experienced I wanna ask, should I use RemoteWebdriver or I can run my script on a server only with Webdriver?

2
  • 1
    You need to better phrase your question and focus on one problem at the time. I'm quite confused after reading your post.
    – pavelsaman
    May 28, 2021 at 8:46
  • "before every deployment" of what? May 29, 2021 at 7:42

1 Answer 1

0

I cannot find more information on how to run the script before every deployment.

If you want to run a script on a server, you would usually use a CI/CD tool to run the command that kicks off the tests (just like you would do locally). CI/CD is essentially "run this command based on this trigger" (deployment, schedule, etc.). You also use Windows Task Scheduler for learning how to run stuff overnight (schedule based).

I want to implement multiple browser testing and handle photo upload

There are many ways of running your tests on different browsers. You'll need the different WebDrivers and a way to swap between them (setting the DesiredCapabilities). Your first test step would be opening the browser passed in by your @DataSource. There is a screenshot command in Selenium but if you are running on a server, you'll need to make sure that they are stored somewhere you can view them.

should I use RemoteWebdriver or I can run my script on a server only with Webdriver?

RemoteWebDriver is the standalone-server.jar and that lets you register WebDrivers (browsers) with the Hub. This allows you to run tests on Edge or Safari from a (including but not limited to) linux host. That's basically how 3rd party services like SauceLabs and BroswerStack run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.