How do we click a checkbox based on label text && type checkbox?

17 views
Skip to first unread message

Sujith C S

unread,
Feb 23, 2017, 2:38:27 PM2/23/17
to seleniu...@googlegroups.com
How do we click a checkbox based on label text && type checkbox?

<span class="GTM_1_King">
<div class="jcf-unselectable jcf-class-selectFocus jcf-class-chkFilterOption jcf-class-roomPreferencesFilterNarrowResults chk-area chk-checked">
<span/>
</div>
<input id="K" class="selectFocus chkFilterOption roomPreferencesFilterNarrowResults jcf-hidden" data-operation="AND" data-code="K" data-name="1 King" filter-code="Room Preference" data-filter="roomPreferencesFilterNarrowResults" checked="checked" type="checkbox"/>
<label class="chk-label-active" for="K" style="float:left">Super User </label>
</span>

--like this   .//*[@type='checkbox']  && label = Super User


Thanks

Jegadeesh mani

unread,
Feb 23, 2017, 5:51:41 PM2/23/17
to seleniu...@googlegroups.com
Use ,

//label[text()='Super User'] 

Thanks
Jegadeesh


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CADT5rEKq8MDd6yidRiAGP2G46SEa-rCGVJhh4F9NgWxrysMMeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Sujith

unread,
Feb 23, 2017, 7:42:34 PM2/23/17
to seleniu...@googlegroups.com


Thank you but duplicate label exists in same page but check box with that label only once.

Any help?
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CADrrHivnrEwFfOS2jMiL%3DiqY06RpYhCOxHwDc6sr31pX3qFKzA%40mail.gmail.com.

Jegadeesh mani

unread,
Feb 24, 2017, 3:58:00 AM2/24/17
to seleniu...@googlegroups.com
I need entire node otherwise we cannot pic the exact path

On Feb 24, 2017 6:12 AM, "Sujith" <sujit...@gmail.com> wrote:


Thank you but duplicate label exists in same page but check box with that label only once.

Any help?

On 23-Feb-2017, at 2:51 PM, Jegadeesh mani <jegade...@gmail.com> wrote:

Use ,

//label[text()='Super User'] 

Thanks
Jegadeesh

On Feb 24, 2017 1:08 AM, "Sujith C S" <sujit...@gmail.com> wrote:
How do we click a checkbox based on label text && type checkbox?

<span class="GTM_1_King">
<div class="jcf-unselectable jcf-class-selectFocus jcf-class-chkFilterOption jcf-class-roomPreferencesFilterNarrowResults chk-area chk-checked">
<span/>
</div>
<input id="K" class="selectFocus chkFilterOption roomPreferencesFilterNarrowResults jcf-hidden" data-operation="AND" data-code="K" data-name="1 King" filter-code="Room Preference" data-filter="roomPreferencesFilterNarrowResults" checked="checked" type="checkbox"/>
<label class="chk-label-active" for="K" style="float:left">Super User </label>
</span>

--like this   .//*[@type='checkbox']  && label = Super User


Thanks

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages