seleniumhq.github.io icon indicating copy to clipboard operation
seleniumhq.github.io copied to clipboard

[JS]: Missing documentation on running the firstscript.spec.js

Open N1lshui opened this issue 3 years ago • 6 comments

What happened?

I'm not able to run Slenium with Javascript. I try to start my tes.js an dthere is this error

How can we reproduce the issue?

I don't know
test.js

Relevant log output

$ node test.js
[INFO] Searching for WebDriver executables installed on the current system...
[INFO] ... located firefox
[INFO] Running tests against [firefox]
C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:229
  after(function () {
  ^

ReferenceError: after is not defined
    at init (C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:229:3)
    at suite (C:\Users\nbirken\Documents\Selenium\js\node_modules\selenium-webdriver\testing\index.js:374:5)
    at Object.<anonymous> (C:\Users\nbirken\Documents\Selenium\js\test.js:5:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Operating System

Windows 10

Selenium version

4.0.0

What are the browser(s) and version(s) where you see this issue?

Firefox

What are the browser driver(s) and version(s) where you see this issue?

Firefox

Are you using Selenium Grid?

No response

N1lshui avatar Sep 08 '22 15:09 N1lshui

@N1lshui, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Sep 08 '22 15:09 github-actions[bot]

Hi @N1lshui ,

Thank you for raising the issue.

Yes there is a missing info in document on running the test. To execute, please install mocha by npm install mocha and run test using mocha test.js

As this is not an issue with selenium-webdriver i will move this issue to documentation!!!

Thanks, Sri Harsha

harsha509 avatar Sep 08 '22 15:09 harsha509

I can tackle this.

Would it be reasonable to add a last step to run the script here?

dublinsubway avatar Sep 19 '22 12:09 dublinsubway

You can add a comment at the bottom there in the JS tab for how to execute the code: https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md?plain=1#L243 (needs to be updated in all 4 language files)

Can also point people to our example repo for JS.... https://github.com/SeleniumHQ/seleniumhq.github.io/tree/trunk/examples/javascript Which... prompts #1174 since it should be easy for a user to see how to run those on their machine.

Thanks for your help!

titusfortner avatar Sep 19 '22 16:09 titusfortner

Can also point people to our example repo for JS.... https://github.com/SeleniumHQ/seleniumhq.github.io/tree/trunk/examples/javascript Which... prompts #1174 since it should be easy for a user to see how to run those on their machine.

There already is a link to see the code on GitHub at the bottom of the tab. image Do you think it's not enough?

I put the text in other languages in plain English as I, unfortunately, lack language skills, but since quite a chunk of Japanese page is in English anyway, it's acceptable, hopefully.

dublinsubway avatar Sep 30 '22 22:09 dublinsubway

Can someone assign this issue to me please? I will work on this. Or do I need to create PR directly?

reply2sagar avatar Jun 22 '24 05:06 reply2sagar

Hi @N1lshui,

The steps to run JS code have been updated in our documentation.

Closing this as resolved now.

harsha509 avatar Jul 11 '24 04:07 harsha509