I want to find and run a test on this element:
It has a bunch of classes but those classes are used by other elements as well. How can I find this element on webdriver.io using Typescript?
You have a few options to achieve that:
Find by partial text
To find a anchor element whose visible text partially matches your search value, query it by using *=
in front of the query string
For instance:
$('*=Total')
Find by certain text:
The same technique can be applied to elements as well.
For instance:
$('span=Total: 137216');
Find by xPath
To query elements via a specific xPath
$('//body/div[1]/div[1]/main[1]/div[3]/div[1]/div[3]/span[1]')