Link to home
Start Free TrialLog in
Avatar of Ingo Foerster
Ingo Foerster

asked on

Testcafe find element with text

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?
Avatar of lenamtl
lenamtl
Flag of Canada image

Hi,

I don't know which version you are using

For  TestCafe v2015.1
Documentation https://devexpress.github.io/testcafe/documentation/getting-started/
FAQ https://devexpress.github.io/testcafe/faq/

You may want use the helper for this https://devexpress.github.io/testcafe/documentation/extending-testcafe/reporter-plugin/helpers.html

or if you use the Studio version
https://docs.devexpress.com/TestCafeStudio/400157/testcafe-studio
https://www.devexpress.com/products/testcafestudio/
https://docs.devexpress.com/TestCafeStudio/400176/guides/write-test-scripts

as this is a premium / paid product you may try to see if they offer some video or online courses for their clients.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.