Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table id="campaigns">
- <tr>
- <th>Name</th>
- <th>Status</th>
- </tr>
- <tr>
- <td>first data</td>
- </tr>
- <tr data-id="1">
- <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT</td>
- </tr>
- <tr data-id="2">
- <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT</td>
- </tr>
- <tr data-id="3">
- <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT edit</td>
- </tr>
- <tr data-id="4">
- <td>another data</td>
- </tr>
- <tr data-id="5">
- <td>next data</td>
- </tr>
- </table>
- this.remote
- .findAllByXpath("//*[@id='campaigns']/tr"") // get allitem from list
- .then(function (options) {
- return Promise.all(options.map(function (option) {
- return option.getVisibleText()
- .then(function (text) {
- if (text.includes("intern test")) { // checked whether the value is exist
- option.click(); // click the value
- }
- return text;
- })
- }))
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement