Skip to content

Allow SearchElement to be passed as parameter to all selectors. #2755

@GS-Ray

Description

@GS-Ray

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions