Can we access a table element in Script at runtime without a corr. test object? - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Can we access a table element in Script at runtime without a corr. test object? (/Thread-Can-we-access-a-table-element-in-Script-at-runtime-without-a-corr-test-object) |
Can we access a table element in Script at runtime without a corr. test object? - sepgs2004 - 03-27-2009 There is a table in the page (which is inside 1 to 4 hierarchy of nested tables). We can say, following is the structure in my page: Code: <html> In a test action (that runs after this page is loaded/arrived in the run), I would like to read the manual number from this table cell and pass it onto the next/subsequent action in my test. Following is the code that I am doing for this action "FindManualNumber" Code: Set DataPanelDesc = Description.Create() Does the action have to have respective test-objects always associated to it (in the repository) to have the (Expert) script access them during run-time?. In other words, suppose our script accesses a table cell in a page, do we need to have this object in our repository? Initially, I did not have any (test) objects associated to this action. Upon running the above-mentioned action script, Test-run complained saying "Could not find Browser...Page... element etc". So I added the Frame object into the action's local repository. Now test run is not able to find the specific table of my description. I assumed, using the (Expert) script, we can access any object on the page at runtime without a corresponding test object associated/learned in the test/action repository. As my assumption does not sound quite right!!! Let me suppose it does (i.e. test always needs a test object even if we access it at run time completely using the script), Can I not just have the test learn only (until) the (Browser->Page->)Frame object and access the table elements (which is a nested child of this learned Frame object) this way (as the code above)? Your answer will clear one of my few critical doubts. Thanks for your help. RE: Can we access a table element in Script at runtime without a corr. test object? - anil2u - 10-14-2013 Hi, You need to have a corresponding object for the script to run, to whatever heirarchy you are refering to. If you want to execute without using Object Repository, you have to use descriptive programming... i.e. supplying the object's properties to the script i.e. Browser("creation time:=0).Page("title:=google").. as such. Hope this helps, Cheers Anil |