I’m following a tutorial and am having trouble accessing an element on a website using testcafe. The person in the tutorial does not have this problem and there are no comments on the tutorial regarding.
I have a constructor with a selector that is trying to access a button on a page and then called from another script. Here is selector code piece
this.continueBtn = Selector("input.button-1.new-address-next-step-button")
The element I am trying to reach on the website
<button type="button" name="save" class="button-1 new-address-next-step-button"
onclick="Billing.save()" data-hammerhead-focused="true">Continue</button>
I am getting an error that says:
The specified selector does not match any element in the DOM tree.
> | Selector('input.button-1.new-address-next-step-button')
I have tried to reach it using [name=’save’], instead of input I used button but then they said the element is hidden. Tried .withText(“Continue”). and some other similar things but nothing seems to be working.
Note: the “Input.classname” works on most other selectors.
Can anyone help me out, or explain why this is happening?