Check box not getting clicked

I tried to click on a check box in the link http://www.deal4loans.com/agent.php .But it is not getting checked .Below is my code .For the check boxes to appear we need to select 2 nd option from the I am drop down

But I have noticed that if the code is written only to check these check boxes without adding data for all other fields except the check boxes it works .But when we enter data for Name,mail id,Iam ,city,mobile then the Product you deal will not work .

Please help.Below is my code :

 

Meghna Default Asked on December 12, 2014 in Selenium WebDriver.

any Exception or Error..?

on December 12, 2014.

PLease close this question.

on December 15, 2014.
Add Comment
1 Answer(s)

Hi Megha,

The strategy of locating an element on your code is not suggested.

1) First you are following the xpath over ID & Name locators. I see that all the checkboxes have ID and name available with it, no need to use of xpaths.

2) Even if it is a xpath, always follow relative xpaths, avoid using absolute xpaths.

Now coming back to your question, if you click on I am select list, your xpaths get change, this is the reason your xpath is not working. Get the xpath after filling up all the details.

Close this question please.
Regards,
Lakshay Sharma

xLov3rDns Professor Answered on December 12, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.