notfluffy
notfluffy

Reputation: 101

Testcafe: Unable to select the element even after passing the right selector. Any help will be appreciated?

enter image description here

await t.click(Selector('.select2-search-choice-close'));

Can someone help me with what is wrong here?

Upvotes: 0

Views: 116

Answers (2)

Ilya Afanasenko
Ilya Afanasenko

Reputation: 527

If this question is still relevant for you, try the Visual Selector Debugger. With it, you can directly see in the browser which elements the selector matches, or you can automatically generate a selector for the selected element.

Upvotes: 0

VysakhMohan
VysakhMohan

Reputation: 567

Try,

await t.click('.select2-search-choice-close');

Upvotes: 1

Related Questions