3 replies [Last post]
rfresh
rfresh's picture
Offline
newbie
Last seen: 5 years 31 weeks ago
Timezone: GMT-7
Joined: 2015-03-21
Posts: 4
Points: 5

I have been tasked by my company to use Selenium WebDriver and write some automation scripts...in java.

Our company website uses divs and spans for almost everything so there are not many normal HTML tags.

We have 'radio' buttons that have a Yes/No look to them. The user clicks on Yes or No to check and uncheck it.
I'm trying to put together some cssSelector code to detect if a given radio button is set to Yes or No.

The key to determing this is the <div class 'ui-state-active' right below the <div id="A0588:search section.

Since many items on the web page use the class 'ui-state-active', I have to use that plus another element to narrow it down. Specifically the <div id="A0588:search-panels:governmentProperty" section narrows it down to the correct radio button to detect its Yes/No state.

I'm at a loss as to how to write the ccSelector line to combine these two css selectors (I am fairly new to css).

Thanks for any help and suggestions.

<td class="ui-panelgrid-cell nc4pr-logistics-values-left" role="gridcell">
<div id="A0588:search-panels:governmentProperty" class="ui-selectonebutton ui-buttonset ui-widget ui-corner-all boolean-value">
<div class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left ui-state-active">
<input id="A0588:search-panels:governmentProperty:0" class="ui-helper-hidden" type="radio" checked="checked" onchange="nc4prRequestLogisticsChanged();" value="Yes" name="A0588:search-panels:governmentProperty">
<span class="ui-button-text ui-c">Yes</span>
</div>
<div class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right">
</div>
</td>

//mode edit: source code fixed (I think) ~gt

rfresh
rfresh's picture
Offline
newbie
Last seen: 5 years 31 weeks ago
Timezone: GMT-7
Joined: 2015-03-21
Posts: 4
Points: 5

I posted code but I don't see

I posted code but I don't see it in my post so I will try adding my code again.

<td class="ui-panelgrid-cell nc4pr-logistics-values-left" role="gridcell">
<div id="A0588:search-panels:governmentProperty" class="ui-selectonebutton ui-buttonset ui-widget ui-corner-all boolean-value">
<div class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left ui-state-active">
<input id="A0588:search-panels:governmentProperty:0" class="ui-helper-hidden" type="radio" checked="checked" onchange="nc4prRequestLogisticsChanged();" value="Yes" name="A0588:search-panels:governmentProperty">
<span class="ui-button-text ui-c">Yes</span>
</div>
<div class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right">
</div>
</td>

rfresh
rfresh's picture
Offline
newbie
Last seen: 5 years 31 weeks ago
Timezone: GMT-7
Joined: 2015-03-21
Posts: 4
Points: 5

The key to determing this is

The key to determing this is the

rfresh
rfresh's picture
Offline
newbie
Last seen: 5 years 31 weeks ago
Timezone: GMT-7
Joined: 2015-03-21
Posts: 4
Points: 5

The key to determing this is

The key to determing this is the div class 'ui-state-active' right below the div id="A0588:search section.
Since many items on the web page use the class 'ui-state-active', I have to use that plus another element to narrow it down. Specifically the div id="A0588:search-panels:governmentProperty" section narrows it down to the correct radio button to detect its Yes/No state.
I'm at a loss as to how to write the ccSelector line to combine these two css selectors (I am fairly new to css).