-1

I have a few pages on which I am running nightwatchjs to execute an end to end test.

<div role="tab" aria-selected="true" title="My TV"><span>MyReal TV</span></div>

I have a few tabs that I try to verify using code similar to below:

.verify.elementPresent('div[role="tab"][title="Portfolio"]', 1000)

The above works fine for the Portfolio tab. However, I have two tabs that fail and is returning not found. My Tv and Daily Report . Below fails for My Tv:

.verify.elementPresent('div[role="tab"][title="My Tv"]', 1000)

The Daily Report fails as well. I am wondering if it has something to do with the space in my title? Is there anything else I am doing wrong?

Nathaniel Ford
  • 16,853
  • 18
  • 74
  • 88
Nuru Salihu
  • 4,096
  • 16
  • 58
  • 100
  • 1
    try `div[role="tab"] span[text()="My Tv"]` instead of `div[role="tab"][title="My Tv"]` – Andersson May 30 '16 at 08:52
  • @Andersson thanks for the prompt reply. It doesn't work . Still returning not found. – Nuru Salihu May 30 '16 at 09:12
  • 1
    I dont think space was the reason, can you upload the the html block of that tab so i can see some for attribute ? ps: you just want to verify the tab and elements within , or do something more? – Bao Tran May 30 '16 at 09:33
  • 1
    @NuruSalihu, Can you check whether your `div` located inside `iframe`/`frame` element or not? – Andersson May 30 '16 at 09:37
  • Gus please i apologised for westing your time. It turns out the url returned was wrong. The url comes in a json object and considering its not new , didn't bother to check. Have spent hours on this just to learn this now . Thank you for your time. – Nuru Salihu May 30 '16 at 10:29

1 Answers1

0

It turns out the url was wrong in my case. It was frustrating, spent hours to learn this.

Something like below was returned for the url

http://stackoverflow.com//questions

Instead of

http://stackoverflow.com/questions
Nuru Salihu
  • 4,096
  • 16
  • 58
  • 100