Failed to select Checkbox in web page

6 posts, 0 answers
  1. Chandrasekhar
    Chandrasekhar avatar
    7 posts
    Member since:
    Apr 2013

    Posted 12 Jun 2013 Link to this post

    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
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 12 Jun 2013 Link to this post

    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!
  3. Chandrasekhar
    Chandrasekhar avatar
    7 posts
    Member since:
    Apr 2013

    Posted 12 Jun 2013 Link to this post

    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

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 14 Jun 2013 Link to this post

    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!
  5. Chandrasekhar
    Chandrasekhar avatar
    7 posts
    Member since:
    Apr 2013

    Posted 17 Jun 2013 Link to this post

    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
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 18 Jun 2013 Link to this post

    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!
Back to Top