<div class="toggle-slide-button"> <label for="privacy-mode"> <span>Privacy mode</span> <span class="toggler off"> <span class="text">Off</span> <span class="handle"> <input checked="checked" data-offtitle="Off" data-ontitle="On" id="PrivacyMode" name="PrivacyMode" title="Off" type="checkbox" value="true" /><input name="PrivacyMode" type="hidden" value="false" /> </span> <span class="glow"></span> </span> </label> </div>
I have tried using selenium.WebDriverBackedSelenium.Check("PrivacyMode"), selenium.WebDriverBackedSelenium.Uncheck("PrivacyMode").
I tried IWebElement.Click() also, but none of them working.
But selenium.WebDriverBackedSelenium.IsChecked("PrivacyMode") retuning correct value based on checkbox chek or uncheck.
Please help me.
Thanks.
Okay... I am guessing you are not using Java, since your capitalization is all wrong and you would just use selenium.checked() where selenium is declared as .
Using the Java versions and WebDriverBackedSelenium I am having no problems with check() and uncheck().
So whatever language binding you are using seems to be at fault here.
Mike
On Friday, June 1, 2012 9:13:33 AM UTC-7, Naresh wrote:Hello all,I am trying to Check or Uncheck a checkbox using selenium. But it's not working.Here is my HTML.<div class="toggle-slide-button"> <label for="privacy-mode"> <span>Privacy mode</span> <span class="toggler off"> <span class="text">Off</span> <span class="handle"> <input checked="checked" data-offtitle="Off" data-ontitle="On" id="PrivacyMode" name="PrivacyMode" title="Off" type="checkbox" value="true" /><input name="PrivacyMode" type="hidden" value="false" /> </span> <span class="glow"></span> </span> </label> </div>I have tried using selenium.WebDriverBackedSelenium.Check("PrivacyMode"), selenium.WebDriverBackedSelenium.Uncheck("PrivacyMode").I tried IWebElement.Click() also, but none of them working.But selenium.WebDriverBackedSelenium.IsChecked("PrivacyMode") retuning correct value based on checkbox chek or uncheck.Please help me.Thanks.
--To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/vPR64XRKNIQJ.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
if (!webElement.GetAttribute("type").ToLower().Equals("checkbox"))
{
throw new Exception("This elementLocator is not a checkbox!");
}
if (!webElement.Selected)
{
Click(webElement);
<div class="toggle-slide-button"> <label for="privacy-mode"> <span>Privacy mode</span> <span class="toggler off"> <span class="text">Off</span> <span class="handle"> <input checked="checked" data-offtitle="Off" data-ontitle="On" id="PrivacyMode" name="PrivacyMode" title="Off" type="checkbox" value="true" /><input name="PrivacyMode" type="hidden" value="false" /> </span> <span class="glow"></span> </span> </label> </div>
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/CfsFqnS2WMgJ.
--
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-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c86ee2a4-0635-4c60-8cf9-140d66fa38f7%40googlegroups.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-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/449dce9b-b815-45d0-87ae-07ed4f4aacec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.