Share
Go down
venugopald
Active particpant
Active particpant
Posts : 10
Join date : 2012-06-11

how to identify whether the checkbox is clicked or not using IF condition in selenium

on Wed Jul 18, 2012 8:48 pm
Hi,
i want to unclick checkbox if it is selected using if method in selenium
venugopald
Active particpant
Active particpant
Posts : 10
Join date : 2012-06-11

Re: how to identify whether the checkbox is clicked or not using IF condition in selenium

on 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

on 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
}
venugopald
Active particpant
Active particpant
Posts : 10
Join date : 2012-06-11

Re: how to identify whether the checkbox is clicked or not using IF condition in selenium

on 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

on Thu Jul 19, 2012 7:36 pm
No problem, I had to figure that out yesterday for myself too lol.
Sponsored content

Re: how to identify whether the checkbox is clicked or not using IF condition in selenium

Back to top
Permissions in this forum:
You cannot reply to topics in this forum