Testcafe find element with text

Ingo Foerster
Ingo Foerster used Ask the Experts™
I'am new to TestCafe and website testing. I startetd my first test with TestCafe and it works well. Now I want to add some functions and own steps to it but  have problems to understand the usability a little bit.

I want to find a element o the site. Only if this element do not exists I want to start some actions. If the element exists I want to jump. I think the best way is to make a function inside the script, but I have no idea how. Anyone can help me how to find an element with TestCafe, as sample a label "testvalue" and only do some actions if not found?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial