How to perfrom a same operation on diff. page. ? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: How to perfrom a same operation on diff. page. ? (/Thread-How-to-perfrom-a-same-operation-on-diff-page) |
How to perfrom a same operation on diff. page. ? - njnirmal - 08-14-2009 HI.. I am using web application. and i hve to perform the same operation on the 15 links. I hve to just check that whether all the buttons are enabled or disabled.? How it is possbile ? I am enclosing my attached doc. IN this page around 10 pages name . Each page has a same operation .? How we can do it ? Can we use array ? Plsese send me the script regarding this issue ? RE: How to perfrom a same operation on diff. page. ? - basanth27 - 08-14-2009 What is the type of the object which is holding all those links ?? Are they individual links or they are in a collection of a object ?? If i understand you correct, you have to click on the link which navigates to a page and then you have to check whether a button is enabled or disabled ? RE: How to perfrom a same operation on diff. page. ? - njnirmal - 08-14-2009 yes .. you are right .... all these are individual links .. RE: How to perfrom a same operation on diff. page. ? - basanth27 - 08-14-2009 I am just guessing, hope your object hierachy is like, Browser().page().link() ?? If yes, then take the childobjects(links) of the page. Take the childcount of them and then msgbox to see if they are returning the ones you need. The reason is say this is because you can have some other links on that page. You can store all the values of the link in a dictonary object or in a simple array. [ remember this is static, so you may want to handle this from a external sheet]. Compare the name of the link on the page to the one you have stored. Instr and find out if they match and in that loop click on the link. After that in the same loop you can verify the next page occurence of wether the button is enabled or disabled. Few Tips, 1. Search this forum to find out about childobjects. Several instances are found, discussed. 2. I deliberately wrote it up as a summary for you to read and understand and try to decipher and bring out a code of your own. Dont assume me as a sadistic guy who knows the answer but isint willing to help...thats not the case. What you learn of your own stays till the end. If you still couldnt come up with a code or you tried and have errors post it out, i am here to help you. RE: How to perfrom a same operation on diff. page. ? - njnirmal - 08-17-2009 Hi.. thanks for giving me this solutions . But i am a beginner for this QTP. So can u tell me step by step process. so that i can run my script accroing to your answer. RE: How to perfrom a same operation on diff. page. ? - basanth27 - 08-17-2009 NjNirmal - Thanks for your quick Reply. Before i go ahead and give you the code i just want to ask you a question, 1. Did you read my post? If yes, 2. Did you understand what i had written ? If yes, 3. Did you try with the keywords i mentioned ? If yes, 4. Did you find any post similar to the question or the lead i have given ? If yes, 5. Have you tried the code ? If yes, Report your error messages or whatever you have done so far and Just not me anyone over here will be happy to Help !! If The Answer for atleast one of the above question is NO then, 1. Please answer the questions one after the other. In other words this is the step-by-step approach. |