SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Mar 2007
    Location
    Mumbai, India
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Checking the correct Checkbox

    Hi all,

    There is a report that uses pagination . Now earlier what was required was that finding out the dynamic links and then performing actions after clicking on them.

    I am able to loop through the pages and find those links.
    But Now we have a checkbox attached to every link.
    Now the requirement is that now I have to find the link first and by checking the checkbox perform further operations.
    I am now unable to make QTP recognize that checkbox associated with the link.
    I easily get the link.
    But how to check the checkbox associated ?
    Regards,
    Performance Learner

  2. #2
    Senior Member
    Join Date
    Mar 2007
    Location
    Mumbai, India
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    Well,
    I was able to solve the problem but it is not a very dependable way.
    It would be nice to have some optimized result
    Regards,
    Performance Learner

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    First of all you should tell your current solution for some one else to comment if there is a better solution than what you already have.

  4. #4
    Member
    Join Date
    Feb 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    hey Ankush,
    Tharun is right...probably if you could explain ure solution it would be better...i had a similar problem...but luckily i realized in my case that the links and checkboxes were in a webtable. So first of all check whether these links are in a webtable or not....

    Cheers!

  5. #5
    Senior Member
    Join Date
    Mar 2007
    Location
    Mumbai, India
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    Tarun,

    After looping thorugh the pages I when I reach the Link I get the "html id" of tha link . The hTml id is say "dgdReport_ctl09_channelUrl ".


    so everytime when I find that link I get the "html id".
    link_htmlid = B.P.link.getroproperty("html id")

    Now using object spy I checked the html id of the checkbox c which was like "dgdReport_ctl09_chkadid" . See this text "ct109" this thing is always common in the link and the its associated link. Now if I go to the next link it would be link "ct110" and the text "dgdReport" is always common for html ids of both checkbox and link. so now I know that html id of that checkbox will contain "dgdReport_ct109" this text.
    and for the rest it was very easy

    checkbox_htmlId = Replace(Link_htmliD,"_ChannelURL","_chkadid")

    All i need to do is now simplay replace that end part of the html id.

    Now using this information I was able to click on that checkbox.

    It is working vey fine without a problem But still I believe that if it would have be done without using html ids it would be better
    Regards,
    Performance Learner

  6. #6
    Senior Member
    Join Date
    Mar 2007
    Location
    Mumbai, India
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    Tarun,

    Now I have giventhe solution hope to get some optimized solution.
    As I dont think that we can alwyas rely on html ids.
    There must be some other way
    Regards,
    Performance Learner

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    The approach looks fine to me. The other way around i can think of is to get the parent table of that link and using ChildItem get the Checbox from that same row.

  8. #8
    Senior Member
    Join Date
    Mar 2007
    Location
    Mumbai, India
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking the correct Checkbox

    Thank you a lot tarun.
    Although I am successfully using my approach. It has never given me any problem(Atleast till now).
    I will get back to you as soon as I try out the approach you suggested.

    Thanks again
    Regards,
    Performance Learner

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:12 AM.

Copyright BetaSoft Inc.