Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having issues getting QTP 10 to recognise an IE frame via DP
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi there, have been using QTP for some time and am fairly happy that I understand the principles of DP and how QTP references objects using the DOM.

My current issue is related to trying to recognise a frame using DP (I have previously done this using the OR without an issue).

I have written the following object to try and recognise my frame object.

Code:
Set frameObjectDesc = Description.Create
frameObjectDesc("micclass").value = "Frame"
frameObjectDesc("name").value = "header"

My actual code has a select case block to change the name parameter - but I have confirmed that code is working correctly and setting the correct parameter value. I can also confirm that these properties are exactly the same as the ones which the OR is using to correctly identify the frame.

On trying to check the existence of this frame using:

Code:
Browser(browserObjectDesc).Page(pageObjectDesc).Frame(frameObjectDesc).Exist(0)

I am getting a General Run Error reported. The error number being reported for this error is -2147467259 - but all google searches I have tried for this error number seem to be related to database issues which don't seem particularly relevant in this situation.

I have searched all over to try and discover the solution to this issue, but nothing has really shed any light on it. Can anyone here help me out?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Could you please add some more information.
A screnshot having the spy on that object would help, also try add some more properties , specially 'index' to identify the object.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Object spy included - have obfuscated a small amount of url info.

I have tried using all of the properties in various combinations and still get a "General Run Error" whenever I try to run the .exist method on this Frame.

I have confirmed the .exist method on both the browser and page I am using.

Not sure how much use this is going to be for troubleshooting, I really am at the end of what I can think of to try!


Attached Files Image(s)
   
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
If this matches more than one object, I can see how that would return a general run error. QTP is not very helpful with errors related to the use of descriptive programming. Try doing this instead:

Code:
Set frameObjectDesc = Description.Create
frameObjectDesc("micclass").value = "Frame"
frameObjectDesc("name").value = "header"
set children=Browser(browserObjectDesc).Page(pageObjectDesc).ChildObjects(frameObjectDesc)
if children.count = 1 then
    <do whatever you would normally do here>
else
    Reporter.ReportEvent micFail, ... (or whatever you want to do here)
end if
set a breakpoint on the line of code after "set children=..." and examine "children.count". My guess is that children.count here is either 0 or > 1. Try that and see if that shows you anything useful.

I'm guessing your code didn't find your frame at all, or it found several matches.
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hmm, very strange - I've tried as you've suggested and am using the ChildObjects to confirm the number of items available, but every time the set children= line is run, I get the same General Run Error that I do when I try to use the .exist method to confirm the existence of the frame.

Sad

It's almost as if the frame doesn't exist, but I have confirmed using developer tools and object spy, it really does exist!
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
are "browserObjectDesc" and "pageObjectDesc" also created via descriptive programming, or are they just strings?
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Ok, that suggestion pointed me in the right direction - seems this one was me being stupid, rather than anything being wrong with the particular code I showed you.

Seems I'd managed to forget (somehow) to return the page description from the function which created it, thus it was trying to use a nothing description for the page. After reading your last comment I looked back and saw my mistake (I had tested the object found a page which existed within the function it was written in, but hadn't checked it outside)

Thanks for your help in pointing me at my own idiocy Big Grin
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Webtable objects recognise as weblist in UFT 12.5 Sharad Kumar 0 1,163 12-06-2018, 04:57 PM
Last Post: Sharad Kumar
Smile I am not getting links under a frame deveshbhatt29 1 2,043 05-29-2014, 05:07 PM
Last Post: Ankur
  QTP Not Able to recognise the object in window application. Sudipta Gusain 4 4,799 04-17-2013, 07:35 PM
Last Post: Benak
  Frame Work venkat369 0 2,428 01-21-2011, 01:54 AM
Last Post: venkat369
  Not able to recognise browser Supriya3072 1 2,160 09-08-2010, 01:21 AM
Last Post: cdesserich

Forum Jump:


Users browsing this thread: 1 Guest(s)