SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jan 2004
    Location
    London
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Permission Denied Error When Access IE DOM

    I am automating a dynamic web app & so have been using the ‘Object’ property to access the IE DOM. This was working fine until a few days ago when I started getting a ‘Permission Denied’ error. This would appear when I tried to access the DOM for the first time in the script. What’s weird is that this error is intermittent, sometimes I get it sometimes it works fine.

    We did have a new version of the application released around the same time this started happening but I just can’t see why this is only happened some of the time.

    I did get this error when the app ran under ‘https’ but as it is now running under ‘http’ I don’t think this is an issue.

    Code
    Browser("Main").Object.document.getElementById("ec c_0").classname

    Anyone see this before or explain what might be happening?

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    You should recognize the object through QTP and then get the class name.

    Msgbox Browser("main").Page("micclass:=Page").WebElement( "html id:=ecc_0").object.className

  3. #3
    Junior Member
    Join Date
    Jan 2004
    Location
    London
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    The code was just an example of where I am seeing the problem.
    Most of the apps objects are built dynamically on the fly & as a result I have to use the DOM to drive it.

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    I have a small disagreement here. When you say application is dynamic, you should still be able to use Descriptive programming to work with dynamic objects like you do with DOM.

    Anyways, Two possible causes of Access denied are
    - The page is not yet loaded completely. This won't always throw the error but sometimes it will

    - Accessing a element across domains within an IFRAME

  5. #5
    Junior Member
    Join Date
    Jan 2004
    Location
    London
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    I understand what you are saying about descriptive programming but because a lot of the elements I am interested in are not referenced by id I am having to do a lot of node walking and so took a decision to use the DOM throughout.

    I am sure the objects (& page) have loaded completely as I can see them in the DOM. So this leaves the possibility of assessing elements across domains.

    How can I check this?
    Is this something that would happen randomly?

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    View the source of the Web Page and see if there are any IFRAME in it.

  7. #7
    Junior Member
    Join Date
    Jan 2004
    Location
    London
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    OK

    There are a couple of IFRAMES in the source. What should I be looking for within them & is there a reason why this is only causing me problems some of the time?

  8. #8
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    is the main web page url and the source url of the IFRAME in same domain?

    Ex -

    Address: http://KnowledgeInbox.com/test.html
    <IFRAME src="http://KIB.com/test2.html"/>

    if you see my address bar is in another domain while my IFRAME source is in another domain and any try to access contents inside IFRAME using dom will fail due to cross domain security implemented by browsers.

  9. #9
    Junior Member
    Join Date
    Jan 2004
    Location
    London
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Permission Denied Error When Access IE DOM

    The IFRAME src don't have a domain mentioned, just a path like
    'dependencies/sl4b/javascript-rttp-provider/empty.html'
    so I don't think it can be this.

    I am beginning to think it may be my QTP options and/or installation; I was getting a 'General Run Error' when trying to access the DOM on any html page.
    When I selected the option to
    'Open the following address when a record or run session begins'
    from the
    'Record and Run Settings'
    window this 'General Run Error' went away.

    Strange thing was that when I reverted back to
    'Record and run test on any open browser'
    I did NOT get the General Run Error again.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:48 AM.

Copyright BetaSoft Inc.