Skip to content

Conversation

@andreabisello
Copy link

No description provided.

@pekkaklarck
Copy link
Member

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.

@pekkaklarck
Copy link
Member

pekkaklarck commented Oct 2, 2017

Also, we nowadays prefer the new strategy:value format with examples. With xpath you need to add an extra space like xpath: //*[contains(text(), 'example')] or otherwise Libdoc will render it as an URL.

@aaltat
Copy link
Contributor

aaltat commented Oct 2, 2017

I agree with Pekka

@andreabisello
Copy link
Author

ok, i will update asap

@aaltat
Copy link
Contributor

aaltat commented Oct 9, 2017

@abioneperhobby how is the update looking?

@andreabisello
Copy link
Author

@aaltat @pekkaklarck new commit pushed

@andreabisello
Copy link
Author

@aaltat @pekkaklarck there is a conflict. i don't know what i should to do. can i solve the conflict? thanks

@pekkaklarck
Copy link
Member

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
Copy link
Contributor

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 |
Copy link
Contributor

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.

pekkaklarck added a commit to pekkaklarck/SeleniumLibrary that referenced this pull request Oct 13, 2017
Also added more XPath examples. This ought to cover enhancements proposed by robotframework#940.
@pekkaklarck
Copy link
Member

@abioneperhobby, does 4724be0 cover what needed? Notice that i's in a PR which hasn't yet been merged.

aaltat pushed a commit that referenced this pull request Oct 19, 2017
* 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.
@andreabisello
Copy link
Author

@pekkaklarck i think yes. with that pull request my pull request can be dropped.

@pekkaklarck
Copy link
Member

Cool, closing this one then. The enhanced docs have also been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants