MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / click

Method click

src/main/java/org/htmlunit/html/HtmlLabel.java:145–160  ·  view source on GitHub ↗

Clicks the label and propagates to the referenced element. {@inheritDoc}

(final Event event,
            final boolean shiftKey, final boolean ctrlKey, final boolean altKey,
            final boolean ignoreVisibility)

Source from the content-addressed store, hash-verified

143 * {@inheritDoc}
144 */
145 @Override
146 public <P extends Page> P click(final Event event,
147 final boolean shiftKey, final boolean ctrlKey, final boolean altKey,
148 final boolean ignoreVisibility) throws IOException {
149 // first the click on the label
150 final P page = super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility);
151
152 // then the click on the referenced element
153 final HtmlElement element = getLabeledElement();
154 if (element == null || element.isDisabledElementAndDisabled()) {
155 return page;
156 }
157
158 // not sure which page we should return
159 return element.click(false, false, false, false, true, true, true);
160 }
161
162 /**
163 * {@inheritDoc}

Callers 3

test_clickMethod · 0.95
typeMethod · 0.45
pressAccessKeyMethod · 0.45

Calls 2

getLabeledElementMethod · 0.95

Tested by 1

test_clickMethod · 0.76