Unfortunately this element doesn't have any CSS classes attached to it. 
Just id, type, title, and value.

On Monday, August 24, 2020 at 10:49:44 AM UTC-5 micha.kutz wrote:

> I was suggesting to find a class to narrow the selector to the actually 
> visible radio button.
> As visibility is usually handled via CSS, there should be some class (e.g. 
> one named "visible-radio-button") that you can use in your selector.
>
> Am Mo., 24. Aug. 2020 um 17:30 Uhr schrieb Ben Frey <[email protected]>:
>
>> Hmm, I'm pretty new to CSS selectors, but since I'm having to use the "id 
>> ends with" selector syntax (e.g. $('[id$=endOfId]')), adding .visible (
>> $('[id$=endOfId].visible')) doesn't seem to work; I get an empty 
>> Navigator. I guess I'll have to do the fallback, unless there's something 
>> I'm missing.
>>
>> On Monday, August 24, 2020 at 10:11:49 AM UTC-5 micha.kutz wrote:
>>
>>> The simplest solution would be to find a selector that is more precise 
>>> as it would avoid creating unwanted Navigator objects. So if you can come 
>>> up with something like
>>> $("#radio1*.visible*").click()
>>> It would be the best way.
>>>
>>> The fallback here would be to get a list of all Navigators and filter 
>>> them using Groovy:
>>> $("#radio1").*find 
>>> <https://docs.groovy-lang.org/latest/html/gapi/org/codehaus/groovy/runtime/DefaultGroovyMethods.html#find(Collection,%20groovy.lang.Closure)>*
>>> (it.*isDisplayed 
>>> <https://gebish.org/manual/current/api/geb/navigator/Navigator.html#isDisplayed()>()*
>>> ).click()
>>>
>>> Am Mo., 24. Aug. 2020 um 16:54 Uhr schrieb Ben Frey <[email protected]
>>> >:
>>>
>>>> I have a page that has one visible instance of a radio button, but the 
>>>> CSS selector (using id$=) returns more than one. How can I select only the 
>>>> visible one so I can use click()?
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Geb User Mailing List" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/geb-user/adc6b76c-a7e5-429a-a984-44754867b385n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/geb-user/adc6b76c-a7e5-429a-a984-44754867b385n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Geb User Mailing List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/geb-user/5bcabd94-f41c-4c79-835b-c44bb3d7f1d2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/geb-user/5bcabd94-f41c-4c79-835b-c44bb3d7f1d2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/5c6ed329-e76b-454a-8a1b-47f92dcc8901n%40googlegroups.com.

Reply via email to