When trying to run the following statement I get a permission denied run error:
strCurrHTML = Browser("CreationTime:=1").Page("micClass:=Page"). Object.all.tags("HTML").item(0).outerHTML
Anyone know if I can get round this?
My linkedIn Profile
Check if "Browser("CreationTime:=1").Page("micClass:=Page") .Object is nothing" give False
Tarun Buy the NEW QTP Descriptive Programming Unplugged Book ** Download QTP Unplugged 2nd Edition eBook for FREE **
If you are trying get the html source code i believe use the below code
strCurrHTML = Browser("CreationTime:=1").Document.Object.all(1). outerHTML
Hi Tarun the outerHTML statement gives "Method Not Supported" and the Object is Nothing does give False.
I hope the page is a HTML one only and the browser is IE. If it is then you can try using innerHTML instead of outerHTML.
If its IE then you can also use a tool called "IE Dom Inspector" to exactly see what DOM is getting created for that HTML page.
Thanks Tarun I'll take a look at the DOM Inspector.
I'm pretty new to QTP and from what I've read on this forum, you are the QTP man, but this is what I've been using to get the HTML of the page (well only the body, which is all I care about). Might be of use.
strPage = Browser(strBrowserTitle).Page(strPageTitle).WebEle ment("html tag:=body").GetROProperty("innerHTML")
Everywhere's within walking distance if you have enough time.
Steve I'm one of bunch of dedicated QTP forum contributors, I hope you become one too.
Unfortunately I can't use any of the GetROProperties on any page but the 1st (the apps have 2 or 3 concurrently open browsers and the odd popup [img]images/icons/frown.gif[/img]
The problem may be that you may have frames in the page even if there is a single one only.
That's what I think, had to go with the nasty "right-click, view source, capture text from notepad" yuk! it looks messy but I suppose it does the trick.