Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // cypress
- cy.get('table tr')
- .each(function ($tr , index, $list){
- if($tr[0].children[2].innerHTML == criteria)
- {
- cy.wrap($tr[0].children[0].children[0].children[0].children[0]).click()
- }
- })
- //testcafe
- const parents = Selector('table tr').child(2).withText(criteria).parent(0);
- const parentCount = await parents.count;
- for(let i = 0; i < parentsCount; i++)
- await t.click(parents.nth(i).child(0).child(0).child(0).child(0));
- // or
- const htmlCriteria = 'some html';
- const parents = Selector('table tr').filter((tr, idx) => {
- // add here any client-side logic that will be executed in the browser
- debugger; // if necessary
- return tr.children[2].innerHTML === htmlCriteria;
- }, { htmlCriteria });
Add Comment
Please, Sign In to add comment