-
Notifications
You must be signed in to change notification settings - Fork 452
Description
First, thanks for a great product! It's really has made writing scripts so much easier!
Please consider allowing SearchElement to be passed as parameter to all selector.
Currently, some selectors allow this, e.g. button, link, image, radioButton, etc., while others, such as textBox, dropDown, checkBox don't. It took me a long to to work out why we can use the $ selector for buttons and links, but I get problems with, for example:
await dropDown( $( '//*/span[text()="Logging Interval"]/ancestor::tr/td[3]/div/select[@class="enumSelect"]' ) ).select( "1 Minute" );
Resulting in the following error:
Error Message: TypeError: You are passing a ElementWrapperto adropDown selector. Refer https://docs.taiko.dev/api/dropdown/ for the correct parameters
I've now found a workaround, in case anyone else stumble on this problem; this works (using the near proximity selector):
await dropDown( near( $( '//*/span[text()="Logging Interval"]/ancestor::tr/td[3]/div/select[@class="enumSelect"]' ) ) ).select( "1 Minute" );
But using the proximity selector means it takes longer to execute. Allowing SearchElement as parameter would make everything consistent and make execution faster. Thanks!