I just replied to your stackoverflow post. Please provide the applicable
html. If `when_present` times out, then something is hiding the element,
and that is likely at the root of your issue.
Titus
On Tuesday, August 9, 2016 at 7:08:25 PM UTC-5, Literate Aspects wrote:
>
> Please, any suggestions greatly appreciated.
>
> Attempting to identify the element to be able to check the checkbox.
>
> REF: "watir webdriver cannot select checkbox input element"
>
> SELECTOR: #sv
> ELEMENT: <input type="checkbox" class="form-checkbox
> form-checkbox--inline" data-js-id-lang="27" id="sv">
>
> Please, any suggestions greatly appreciated. I have tried:
>
> FROM: b.span(:text, 'Svenska').click
> IRB returns: Unable to locate element
>
> FROM: b.span(:text, 'sv').click
> IRB returns: Unable to locate element
>
> FROM: b.execute_script("$('input:checkbox[id=\"sv\"]').attr('checked',
> 'checked');")
> IRB returns: nil
>
> FROM: b.execute_script("document.getElementById('sv').click();")
> IRB returns: nil
>
> FROM: b.checkbox(:id => 'sv').fire_event :onmousedown
> IRB returns: false
>
> FROM: b.checkbox(:id => 'sv').fire_event :onclick
> IRB returns: true
>
> FROM: b.checkbox(:id => 'sv').fire_event :click
> IRB returns: true
>
> FROM: b.checkbox(:id => 'sv').when_present.set
> IRB returns: time out (30 seconds)
>
> FROM: b.checkbox(:id => 'sv').fire_event :set
> IRB returns: true
>
> FROM: b.checkbox(:id => 'sv').fire_event :hover
> IRB returns: true
>
> FROM: b.input(:id, "sv").to_subtype.set
> IRB returns: Element is currently not visible
>
> FROM: b.select_list(:id => 'sv').option(:text => 'sv').select
> IRB returns: Unable to locate element
>
> FROM: b.input(:id, "sv").set
> IRB returns: located=false
>
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.