Why is getText returns nothing for span class data

Viewed 63

Want to get value of a span class named 'spacer-right big project-card-measure-secondary-info'

<span class="spacer-right big project-card-measure-secondary-info">1</span>

code snippet:

  browser.waitForElementVisible('.spacer-right big project-card-measure-secondary-info', 1000)
         .getText('.spacer-right big project-card-measure-secondary-info', (result) => {
         console.log(result)
       })

Returns nothing at the console.

2 Answers

This is Vishal here from the Nightwatch product team. Please try to use .spacer-right.big.project-card-measure-secondary-info as the selector and let us know if it works.

there is 3 classes here class="spacer-right big project-card-measure-secondary-info" spacer-right is a class big is a class and project-card-measure-secondary-info is a class change it to class="spacer-right-big-project-card-measure-secondary-info"

Related