Labels and other objects w/ descriptive programming - 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: Labels and other objects w/ descriptive programming (/Thread-Labels-and-other-objects-w-descriptive-programming) |
Labels and other objects w/ descriptive programming - jjluna - 01-20-2011 Hi there, Let me give you some background about my application first. I have a web application that is almost 80% customizable, in other words, all forms vary from page to page and every time there is a possibly the forms change (may have more fields or less, or more required fields or less, etc.). As a matter of fact if you record a script, it will work only one time as the field names will be changing from one run to the other, therefore my approach was to use only descriptive programming for all the scripts (actions). This worked for many of the modules but for many others it didn't, so I have some questions: 1. In some pages I have over a thousand controls....so reading reading them and verifying which one I needed didn't work very well. For those I use something similar to: Code: Set oDescription = Description.Create() So it works cool for many forms, but for those with a lot of objects....it takes years....So the question here.....do you think this is a good approach? Do you have any suggestion for me here? 2. In other cases when creating the array of objects: Code: Set oDescription = Description.Create() Internet Explorer (7) crashes..... it is IE the one that crashes....but I am sure because of what I am doing in QTP. Now this is only for the highly customized forms.....for the other it always works fine. Do you think I have some sort of process overload or memory leak or something like that? 3. My forms have tables embedded in more tables and so on...so I don't know if there any way to read labels..... for example I would like to read the ID of the form, but when I try to recognize it.....it comes as webelement and I cannot figure it out how to identify it..... if I use a property, such as "innertext".... there will be other webelements without that property or with the property set to null, so the script crashes as the property does not exist or is not supported, how can I read labels?.....using webtables didn't work.....unless I have to get the entire html code and parse for the values...but that's too much no? 4. Lastly... what about the tables.....how can you read a table that does not have a name (property)?.....and once you have, how you manipulate where you are (cell) and what you have (cell content).....could you provide me some guidance?.... I have tried for many days and just can;t make it work....or perhaps I am using the wrong approach. Thanks for your help, understanding and patience. Regards, Juan Luna RE: Labels and other objects w/ descriptive programming - cdesserich - 01-20-2011 Hey Juan, I don't have any good answers for most of those questions but I do see something in #1 that you are doing in a very inefficient manner. The Description object can take more properties than just "micclass." If you add the "name" property, the ChildObjects method will only return those objects that match the specified "micclass" and "name" saving you TONS of loop time. If you give it the "name" property, and if it is valid HTML on the page, it will only return one object. I would suggest adding html tag as well, but it's not necessary. Code: Set oDescription = Description.Create() RE: Labels and other objects w/ descriptive programming - jjluna - 01-21-2011 Christian, Thanks, definitely I was doing it poorly, thanks for the advice....interested in a peer review? Regards, Juan Luna RE: Labels and other objects w/ descriptive programming - cdesserich - 01-22-2011 Peer review? Who's reviewing who? RE: Labels and other objects w/ descriptive programming - jjluna - 01-27-2011 You will be reviewing mine, of course. RE: Labels and other objects w/ descriptive programming - cdesserich - 01-27-2011 I guess contact me by email with more information about what you are interested in me reviewing. |