2

I am using Nightwatch.js to test a website. I want Nightwatch.js to click on a tab on the website, but the click is not working. At least it does not have an effect...

The HTML code of the element to click on looks like this.

<div>
    <ul id="tabs">
        <li id="tiresTab">
            <a href="#tires">Word</a>
        </li>
    </ul>
</div>

In Nightwatch.js I wrote:

.waitForElementVisible('li[id="tiresTab"]', 10000)
.click('li[id="tiresTab"]')

But nothing happens. The tab is not being opened. And the next command in Nightwatch is failing. This means that the click is being performed by Nightwatch, but the tab does not open. However I can open the tab when I manually click it. What could be the problem here?

Garrarufa
  • 1,145
  • 1
  • 12
  • 29
  • 1
    your closing tags are all wrong ... not <\tag> – Jaromanda X Jul 02 '15 at 11:30
  • i typed the closing tags wrong. my fault... but that has nothing to do with my error. i thought i had tried to click the link, not the list element, but indeed thats the solution. i must have done something wrong. thanks for your help. – Garrarufa Jul 02 '15 at 11:39