- venugopaldActive particpant
- Posts : 10
Join date : 2012-06-11
how to identify whether the checkbox is clicked or not using IF condition in selenium
Wed Jul 18, 2012 8:48 pm
Hi,
i want to unclick checkbox if it is selected using if method in selenium
i want to unclick checkbox if it is selected using if method in selenium
- venugopaldActive particpant
- Posts : 10
Join date : 2012-06-11
Re: how to identify whether the checkbox is clicked or not using IF condition in selenium
Wed Jul 18, 2012 8:49 pm
sorry using if condition
- NaviQA
- Posts : 6
Join date : 2012-07-16
Re: how to identify whether the checkbox is clicked or not using IF condition in selenium
Wed Jul 18, 2012 8:55 pm
Basically just get the element and use a .Selected method to see if it is clicked. This is for C#, Java is very similar though.
- Code:
IWebElement chkBox = driver.FindElement(By.Id("Your ID Here"));
if( chkBox.Selected == True)
{
//It is selected put your code here
}
- venugopaldActive particpant
- Posts : 10
Join date : 2012-06-11
Re: how to identify whether the checkbox is clicked or not using IF condition in selenium
Thu Jul 19, 2012 11:23 am
thanks dude
- NaviQA
- Posts : 6
Join date : 2012-07-16
Re: how to identify whether the checkbox is clicked or not using IF condition in selenium
Thu Jul 19, 2012 7:36 pm
No problem, I had to figure that out yesterday for myself too lol.
- Sponsored content
- Failing to identify element using Selenium WebDriver
- Selenium not able to identify confirm dialog box while testing
- how to select checkbox whose id is not known or dynamic with selenium RC
- Selenium : Can't able to identify the objects
- when download button is clicked pop up dialog box displayed , i am unable to automate it.
Permissions in this forum:
You cannot reply to topics in this forum