No element found using locator error
I am trying to click a button but i get all the time that error •Failed: No element found using locator: By.xpath("//h3[contains(text(),'Deluxe\xA0Twin')]/parent::div/parent::div/preceding-sibling::div/div/button[contains(text(),'Book')]")
But when i try it manually then it showing that element is present on that page??
Hi there!
Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.
From the the getting help section of the README:
Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)
Thanks!
Hi Nick,
I have asked around 3-4 questions over Gitter and StackOverflow regarding protractor, but i haven't got any answer for any of my questions.That's why i have asked on Github.
Thanks, Saurabh
On Thu, Feb 18, 2016 at 8:13 PM, Nick Tomlin [email protected] wrote:
Hi there!
Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag http://stackoverflow.com/questions/ask?tags=protractor or post in the Gitter Channel https://gitter.im/angular/protractor to get help.
From the the getting help https://github.com/angular/protractor#getting-help section of the README:
Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/angular/protractor/issues/2955#issuecomment-185750474 .
Hi,
Hi,
Using Xpath selectors is not a better choice as it slows down the element finding mechanism.
I have designed a plugin to address this specific issues: protractor-css-booster
The plugin provides some handly locators to find out siblings in a better way and most importantly with CSS selector.
using this plugin, you can directly use:
var elem = element(by.cssContainingText('a','link text')).element(by.followingSibling('img'));
You can always checkout the other handy methods available here...
Now, you can find web elements such as:
- Finding Grand Parent Element
- Finding Parent Element
- Finding Next Sibling
- Finding Previous Sibling
- Finding any Following Sibling
- Finding First Child Element
- Finding Last Child Element
And, guess what, everything you can find using 💥 CSS Selectors 💥
Hope, it will help you...