I’m trying to prepare a automation framework targeting NodeJS that is intended for developers familiar with JS but not (necessarily) Java. is at the core of the solution because all the applications under test are web-based.

Any working solution using Selenium, for me, must meet the following needs, either built into the framework or something I write manually:

  • Automatic download of the appropriate Selenium driver binary (e.g., if it can’t be found in PATH already).
  • Provides the path of the downloaded driver binary to Selenium (in Java this is done via a system property; other Selenium libraries do it differently)
  • In the case of running locally, will automatically either find an installed browser on the system, or download one according to the type of WebDriver instance requested (example: request ChromeDriver, framework must download Chrome if it isn’t already installed)
  • Provides the path of the web browser to the driver
  • In the case of running against a grid or locally, support headless mode easily (in the case of Chrome this basically means you have to be able to supply a command line argument to the web browser command line)

I am very happy with the of the Java-based Selenium-Jupiter because it meets these needs. It even goes above and beyond by putting the browser in a Docker container, which is quite nice for CI/CD using e.g. Jenkins.

But I want to do the same in without having to basically code up WebDriverManager and selenium-jupiter in NodeJS. Is there anything out there for NodeJS that offers the same sort of features?

Ideally, all of the above features would be available on Win64 platform (interactive and non-interactive, meaning either a user is at the keyboard of a laptop/desktop or it’s a headless box in the cloud) as well as the Linux64 platform without an X server (so, headless Linux box e.g. a Jenkins build agent).

It seems Selenium-Jupiter covers all of the above pretty well, but my primary constraint is the test cases themselves that use WebDriver in JavaScript so that my colleagues can understand them. (The human factors aside here is that going from a primarily functional programming methodology and dynamic typing to a primarily OOP programming language with static typing is a lot to ask for the Java-uninitiated, even though the syntax is similar. And let’s not even get into the Java build tools like Maven that they are unfamiliar with.)



Source link https://sqa.stackexchange.com/questions/35441/writing-selenium-test--in-javascript-with-features-of-selenium-jupiter

LEAVE A REPLY

Please enter your comment!
Please enter your name here