Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <table id="campaigns">
  2. <tr>
  3. <th>Name</th>
  4. <th>Status</th>
  5. </tr>
  6. <tr>
  7. <td>first data</td>
  8. </tr>
  9. <tr data-id="1">
  10. <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT</td>
  11. </tr>
  12. <tr data-id="2">
  13. <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT</td>
  14. </tr>
  15. <tr data-id="3">
  16. <td>intern test at Fri, 09 Dec 2016 03:12:26 GMT edit</td>
  17. </tr>
  18. <tr data-id="4">
  19. <td>another data</td>
  20. </tr>
  21. <tr data-id="5">
  22. <td>next data</td>
  23. </tr>
  24. </table>
  25.  
  26. this.remote
  27. .findAllByXpath("//*[@id='campaigns']/tr"") // get allitem from list
  28. .then(function (options) {
  29. return Promise.all(options.map(function (option) {
  30. return option.getVisibleText()
  31. .then(function (text) {
  32. if (text.includes("intern test")) { // checked whether the value is exist
  33. option.click(); // click the value
  34. }
  35. return text;
  36. })
  37. }))
  38. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement