Forum Discussion

dereksurfs's avatar
dereksurfs
New Contributor
15 years ago

Automated QA VBScript runtime error - Permission denied: 'w2.document'

Hello,



We are using TestComplete to test our web applications.  There is a test case I've used in the past which now errors out with a VBScript Permission Denied error.



Basically what the VBScript code does is read a hidden field on our internal web page using the DOM object model like this:



Set w1 = Sys.Process("IEXPLORE", 2).Page(url)

Set w2 = w1.Form("mainForm").Panel("id_mainScreen")


id1 = Trim(w2.document.all.Item("myHiddenField").value)   '<--------------------------------



Automated QA Errors out here getting the form field value.  The field definately exists in the source which I already double checked.  So that's not the problem. 



I am trying to determine what permissions are required which are now missing/being blocked.  We're running on Windows XP, IE8.  I had our Systems Administrator turn off our firewall to see if that was blocking things.  But that wasn't it.  We do have certain GPOs in place for our IE 8 security which are locked down.  I just need to figure out what Persmissions are needed for this type of DOM access?  Any ideas would be appreciated.



Also our Systems team asked if I could provide them with a small script which would reproduce the access violation on their end.  Unfortunatelty they are not permitted to install TestExecute in their environment. And I haven't found a way yet to simulate AutomatedQA's Sys.Process using VBScript.  Could I use something like WMI to get the process instead? 



Any help appreciated.  Thanks,

2 Replies


  • Hello Derek,





    First, please make sure that you are using the latest version of TestComplete (v. 8.50). Does the problem exist when you are using the latest version?





    The situation may be as follows:

    On the problematic page, AJAX methods are used to update its contents, and even when the page is loaded, its object tree has not been completely built. Normally, TestComplete automatically waits until the page is loaded, but when AJAX is used to update the page's contents, the tool does not have means to automatically recognize the moment when the page's object tree has been entirely built. To check if this is your situation, add a delay before getting the myHiddenField object, for example:





    Delay(120000)   'wait for 2 minutes to make sure that the page is completely loaded

    id1 = Trim(w2.document.all.Item("myHiddenField").value)





    If the problem remains, try to reproduce the same problem on another machine to check whether the problem is machine-specific and let us know the results.







    And I haven't found a way yet to simulate AutomatedQA's Sys.Process using VBScript. Could I use something like WMI to get the process instead?



    I'm afraid that the abilities of WMI are not enough to emulate the problem when TestComplete is trying to obtain the value of the myHiddenField item. Moreover, it is unlikely that the problem is on the side of the tested application, so there is nothing to investigate and fix for the developers.
  • dereksurfs's avatar
    dereksurfs
    New Contributor
    Thanks Alex,



    We are actually in process of upgrading to the latest version for better compatablity with IE8. 



    On another note I was able to finally get it to work by examining the object analyzer.  Then trying some different settings to get to the hidden field.



    It turns out it is accessing the hidden field page objects differently in IE8 vs. IE7.  It ended up having nothing to do with permissions.  So the error message was completely misleading and irrelevant .  Surprise, surprise.



    Thanks again,