Last active
July 19, 2019 07:00
-
-
Save bablukpik/300cd6e37e51ed693026edd359f4891c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To find closest id using jquery | |
var id = $("button").closest("div").prop("id"); | |
// To find closest id using javascript | |
<li id='myLi' onclick="alert(this.parentNode.id)">A</li> | |
// Menu Text Related | |
await this.waitFor(`//a[contains(@class, 'selected') and contains(text(), '${tabName}')]`); | |
await this.waitFor(`//a[contains(@class, 'selected') and text()='${tabName}']`); | |
### Decendent Element find | |
//div[contains(text(), 'Cancellation')]/parent::div/parent::div/following-sibling::div | |
### Sibling find based on string | |
//div[contains(text(), 'Cancellation')]/following-sibling::div | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment