Nightwatch.com without Java js

Can I use nightwatch.com without installing Java js? There are official selenium JavaScript bindings (webdriverjs, selenium webdriver) Do you need Java?

Solution

I'm catering to a JavaScript community, so I'm trying to run nightwatchjs locally instead of introducing Java myself I'm sure that if you run a remote selenium server, the remote instance must run a java server to pass commands to the remote browser specific driver For example: Chrome driver

In other words, my impression is that the standard client can be directly connected to the local standard webdriver (chrome driver) without using java selenium-server-standard-2 xx. 0. Jar server Since nightwatchjs is the first client I have tried, it is difficult to find a working configuration because all documents show what Nate Stone said above All the examples I've seen show that selenium-server-standard-2 needs to be specified xx. Location of 0.jar:

selenium": {
  "start_process": true,"server_path": "lib/selenium-server-standalone-2.53.0.jar","cli_args" : {
    "webdriver.chrome.driver" : "/Users/greg.kedge/bin/chromedriver"
  },"log_path": "integration/log" }

That's what I said: if you want nightwatch to start (and stop) the server ("start_process": true) for you during the test, it seems necessary to run the java server

However, through a large number of trials, if you want to start the chrome driver on the command line and use the chrome driver all the time, I can run the chrome driver without Java selenium independence Caveat: I've only tried it on OS X so far... So suppose chrome driver is in $path:

% chromedriver --url-base=/wd/hub
Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 9515
Only local connections are allowed.

Now grab the port (9515) and update your nightwatch JSON to indicate that you want to use chrome I'm setting the default settings, but you can set the chrome specific environment From nightwatch Completely delete the "selenium" block in JSON. Now tell nightwatch that it can find the running server and the browser type of the service:

"test_settings": {
    "default": {
      "launch_url": "http://localhost:8888/","selenium_host": "127.0.0.1","selenium_port": "9515","silent": true,"firefox_profile": false,"screenshots": {
        "enabled": false,"path": ""
      },"desiredCapabilities": {
        "browserName": "chrome","javascriptEnabled": true,"acceptSslCerts": true,"__commentOut: chromeOptions" : {
              "args" : ["start-fullscreen"]
            }
      },}
  }

Using it in this way is useful to me; I can run nightwatch to drive chrome without a Java selenium stand-alone server Again, this is using the always running chrome driver on OS X I can't figure out how to get nightwatch management to start / stop chrome driver without adding a Java selenium stand-alone server

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>