简体   繁体   English

测试咖啡馆:如何根据列中的特定文本找到一行并单击同一行内不同单元格中的链接

[英]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例如,在表格中查找文本“autotest3”并单击同一行中的相应链接

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:您可以指定一个选择器,它将根据“名称”列中的文本查找特定表格行,然后从第 3 列中查找子元素(表格单元格)。例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何根据单元格单击突出显示表格行? - How can I highlight a table row based on a cell click? 当我单击该行中的React组件链接时,如何防止该行单击? - How can I prevent a row click when I click a React component link within that row? 单击表格行中基于该行文本的链接 - Click a link in a table row based on text in that row 根据列单元格值清除特定行 - Clear specific row based on a column cell value 如何基于量角器中的文本单击表中的链接 - how to click link in a table based on the text in a row protractor 如何单击具有特定文本列的表行的元素? - How to click an element of a table row that has a column with specific text? 如何单击列上的图像来编辑同一行上其他列上的文本? - How to click image on column to edit text on other columns on the same row? 在具有行标题和列标题的表中,给定列标题文本和单元格文本,如何选择单元格(td)? - In a table with row headers and column headers, given a column header text and a cell text, how can I select a cell (td)? 连续两次单击触发链接时,如何防止click事件执行相同的查询 - How can I prevent a click event from executing the same query when the triggering link is clicked twice in a row 为特定行和特定列中的单元格停用点击事件 - Deactivate click-event for a cell in a specific row and a specific column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM