简体   繁体   中英

Test cafe: How can i find a row based on a specific text in column and click link in a different cell within the same row

I have a table that looks something like this: Table

I am trying to click the "link" based on the text in the "name" column. eg Look through table for the text "autotest3" and click the corresponding link in the same row

You can specify a Selector that will find a specific table row based on the text from the "Name" column and then find a child element (table cell) from column 3. For example:

await t.click(Selector('tr').withText('Autotest2').find('td').withText('Link'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM