- Notifications
You must be signed in to change notification settings - Fork 781
Improved xpath locator documentation #940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| This is a good example to add, but I'm not sure does it deserve its own table. What about changing the xpath example above the table you added to contain this xpath instead? Then you could add a comments to all examples in that table explaining how different locators work. There are similar comments in the examples in the Default locator strategy section. |
| Also, we nowadays prefer the new |
| I agree with Pekka |
| ok, i will update asap |
| @abioneperhobby how is the update looking? |
| @aaltat @pekkaklarck new commit pushed |
| @aaltat @pekkaklarck there is a conflict. i don't know what i should to do. can i solve the conflict? thanks |
| You could update and rebase your fork. If you don't know git too well, it may be easier to just create a new fork and new PR. I can also add such an example myself. |
| requires that the system under test contains the jQuery library. | ||
| This will Click Element containing ABC text. Notice that this approach can be error prone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is worth of mention. We are trying to explain how the library is working and not trying to explain how xpath works.
| | `Click Element` | (//div)[2] | | ||
| | `Click Element` | //div[@id="container"] | Click Div With id : container | | ||
| | `Click Element` | (//div)[2] | Click the second div in the document | | ||
| | `Click Element` | xpath=//*[contains(text(),'ABC')] | Click element containint text ABC | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make the column same size by adding spaces. The first two examples, column two and three needs some adjustments, because last example has longer column width.
Also added more XPath examples. This ought to cover enhancements proposed by robotframework#940.
| @abioneperhobby, does 4724be0 cover what needed? Notice that i's in a PR which hasn't yet been merged. |
* Cleanup. - Remove unnecessary coupling between Element and FormElement keywords. - Enhance related error message. - Enhance documentation of ElementKeywords (#925). - Add '.' at the end of error and log messages. - Introduce `ContextsAware.find_elements` helper. - Change default value of optional `message` from '' to None. - Use `is_noney` instead of `is_falsy` when default value is None. - General (and trivial) cleanup to code and tests. -Also added more XPath examples. This ought to cover enhancements proposed by #940. - Doc string to `find_element`. Mainly to give type hits to IDE but higher level APIs should get more docs in general. - Introduced ElementNotFound error that `ElementFinder.find` uses. - Move helpers to ContextAware and LibraryComponent to avoid unnecessary coupling between different library componets. - Remove unnecessary helpers when `find_element(locator).method()` works as well. - Rewriter internal logic with `Wait` keywords. This includes consistently handling non-existing elements. - Make unregistering strategy that hasn't been registered an error. - Consider `<input type="file">` text element consistently. - General cleanup here and there. - Move frame related kws to own lib component - "Element Should (Not) Be Enabled" and "Wait Until Element Is Enabled" now all validate that the element is enabled and not readonly. Also removed broken element type validation from the former keywords. - Doc that elements considered enabled cannot be read-only - Base class for SeLib exceptions - Test "Page Should Contain" with text spanning multiple elements. - User `find_elements` instead of `find_element` when possible. - Avoid `strategy=value` locator syntax in code. - Enhance error messages when radio buttons not found. - Cleanup `Choose File` test and test it with Firefox. - TableElementFinder._locator to public class variable. - Remove useless documentation. Fixes #958.
| @pekkaklarck i think yes. with that pull request my pull request can be dropped. |
| Cool, closing this one then. The enhanced docs have also been merged. |
No description provided.