Hi, how would I provide the HTML he asked for?  I have tried as well as
posting a screen shot, but the HTML does not post and there is no place to
upload a screen shot.

**** html is here ==>  <input class="form-checkbox form-checkbox--inline"
data-js-id-lang="27" id="sv" type="checkbox"> ****


On Tue, Aug 9, 2016 at 5:42 PM, 'John Fitisoff' via Watir General <
[email protected]> wrote:

> It's most likely exactly what Titus suggested. One other thing you can do,
> in addition to providing the HTML he asked for, is to see how many elements
> there are that match. Stuff like this:
>
> b.checkboxes(:id => 'sv').length # More than 1? If so, the one you want
> may be one of the others
>
> b.checkboxes(:id => 'sv').find_all { |cb| cb.present? }.length # Count of
> how many are accessible.
>
> b.checkboxes(:id => 'sv').each  { |cb| cb.set if cb.present? } # Set any
> that are accessible.
>
> ...and variations of that, kind of like how you were doing it below...
>
>
>
> ------------------------------
> *From:* Literate Aspects <[email protected]>
> *To:* Watir General <[email protected]>
> *Sent:* Tuesday, August 9, 2016 5:31 PM
> *Subject:* [wtr-general] Re: "watir webdriver cannot select checkbox
> input element"
>
> WOW, thank you!
>
> What do I need to supply back to you?
>
> Jon
>
> On Tuesday, August 9, 2016 at 5:13:48 PM UTC-7, Titus Fortner wrote:
>
> 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.
>
>
> --
> --
> 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 a topic in the
> Google Groups "Watir General" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/watir-general/dsU7CfM9P5I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
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.

Reply via email to