This is a migrated thread and some comments may be shown as answers.

Failed to select Checkbox in web page

5 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chandrasekhar
Top achievements
Rank 1
Chandrasekhar asked on 12 Jun 2013, 08:58 AM
Hi all,

Scenario 1:
In web page i have 10 check boxes, irrespective of their names i want to select 4th checkbox
(in QTP we can do using index method,  webcheckbox("index:=3").checked = True)

Scenario 2:
wanted to check all the checkboxes in the page (irrespective of their names and count)

Any help plz

Thanks in advance

Thanks,
Chandra

5 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 12 Jun 2013, 09:29 AM
Hello Chandra,

Thank you for contacting us.

The fastest and easiest way is to insert all check boxes into a list and then check some of them or all of them (the second scenario) via a coded step

IList<HtmlInputCheckBox> list = ActiveBrowser.Find.AllByAttributes<HtmlInputCheckBox>("type = checkbox");
//First scenario
list[3].Check(true, true);
//Second scenario
foreach (HtmlInputCheckBox item in list)
            {
                item.Check(true, true);
            }

I recorded a short video as a demonstration.

Let me know if you need further assistance.

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Chandrasekhar
Top achievements
Rank 1
answered on 12 Jun 2013, 10:07 AM
Hi Boyan Boev,

Thanks for the quick reply
Error was observed during the run, Please find below

InnerException:
ArtOfTest.WebAii.Exceptions.FindException: Find Details:- FindParam used: [Find logic: Use 'AttributesOnly' where (type = checkbox) ]- Start Element: null

Analysis:
the reaseon for the failure is, check boxes are availble in the separate window rather than the parent browser window.

How to proceed further now, I tried to resolve but errors were shown

 

/* Window sWindow = WindowManager.FindWindowRecursively((IntPtr.Zero, "&Set Active List", false, 0);
IList<HtmlInputCheckBox> list = sWindow.AllChildren<HtmlInputCheckBox>("type = checkbox");

 

 Thanks,
Chandra

0
Boyan Boev
Telerik team
answered on 14 Jun 2013, 10:31 AM
Hello Chandrasekhar,

You need just to locate the check boxes in the new widows. Did Test Studio connect to it?

In order to assist you best please:

1. Please send us the execution log.

2. Can you please record a Jing video demonstrating the issue? 

3. If you continue to have difficulty, we'll need to reproduce the issue locally in order to investigate what is happening and find a workable solution for you. Please provide us with a copy of your test and access to your application. If it is not possible to grant us access to your application, please take a Fiddler trace using FiddlerCap and send it to us in a zip file.

Hope to hear from you soon.
 

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Chandrasekhar
Top achievements
Rank 1
answered on 17 Jun 2013, 07:50 AM
QTP and VSTS CodeUI Tests has batter way to handle this situaltion.

Facing lot of issues with Telerik object identification

Thats all I can say
0
Boyan Boev
Telerik team
answered on 18 Jun 2013, 02:28 PM
Hi Chandrasekham,

Please provide us the detailed information as I asked you in the previous response and we will do our best to help you out with all problems you are experiencing.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Chandrasekhar
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Chandrasekhar
Top achievements
Rank 1
Share this question
or