Skip to content
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

Checkbox get label improvement #62

Closed
wants to merge 4 commits into from
Closed

Checkbox get label improvement #62

wants to merge 4 commits into from

Conversation

proxeter
Copy link
Contributor

@proxeter proxeter commented May 5, 2014

#44 issue

@proxeter proxeter closed this May 5, 2014
@proxeter proxeter reopened this May 5, 2014
@artkoshelev
Copy link
Contributor

don't think we need such complex heuristics in framework. you can write your own "labeled checkbox" element, where describe how to find a label.

@aik099
Copy link
Contributor

aik099 commented Aug 11, 2014

These are not a complex heuristics @artkoshelev , but merely a way of finding element's label, used by browser. I've did similar things in PHP version of HtmlElements: https://github.com/qa-tools/qa-tools/blob/master/library/QATools/QATools/HtmlElements/Element/LabeledElement.php#L29-L48

In fact I've standardized label locating way for every element that can have label (e.g. radio button and checkbox), so no code duplication occurs, as in this case.

if (id != null) {
// Label with matching "for" attribute
// Trying to find element from !ROOT! node
String xpath = String.format("(//label[@for = %s])[1]", id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants