Learning Web Automation Nightwatch.js, don't understand what to write

Hello😌
I’m a beginner in Testing and now learning Web Automation with Nightwatch.js, in Visual Code.
I began testing Github, got task to create repository. And issue with 17 line - don’t understand what correctly to write. Also - where in DOM tree to find. There are screenshots that I tried to make visible what I search and don’t understand.
Maybe someone can help me with this line 17, how correctly it should be.

1 Like

I have not used Nightwatch in a while.
Have a look at this Free Course if you want to learn how to setup, check elements and more

Never used Nightwatch, but if the tutorial you followed got ‘me’ to write that code, I would back up my horses and approach from a different angle entirely. It’s not wrong code, it’s just incomprehensible to anyone who has not got years of web app testing experience behind them. Soooo welcome to the ministry of test. and thank you for the super brave starting question. I hope you will stay and find your people or tribe here. This is an awesome bunch.

The locator you have on line 17 is pretty much trash, that’s your problem, but training on a public website that is not designed for learning is not a great start. I suggest trying another tutorial , not just for Nightwatch, but for web testing in general. There are loads of them in various threads - example Automation locators - css vs xpath - #3 by testerfromliverpool . Because it’s not just line 17 that is not great, and using an easier to test website for your learning is going to get you more value, and will also teach you how to get rid of those pause (5000) lines, those are the opposite of maintainable test code. Once again welcome and great starter question, hope we can gently guide you along.

NightwatchJS tries to explain what the issue is here but the web can be really bad. Weirdly, Github isn’t really following web standards as id=:2: isn’t a valid ID. They need to start with a letter. I’m not expecting you to know this, I know this from having worked on Browsers, Selenium, and NightwatchJS for years.

Next time you get stuck there, add .debug() call just before the wait and then add --debug to your cli command. You can see it in action on our YouTube account https://www.youtube.com/watch?v=U8FbtsgPtU8

You can always ask questions in more real time on our Discord Nightwatch.js