com exception

4 views
Skip to first unread message

Tim Wisniewski

unread,
Mar 25, 2007, 6:37:55 PM3/25/07
to watij
Hi,

I'm using watij with IE 7. The site is rather complex with frames and
such. There is a navigation menu at the top. When watif "clicks" on
a link from the navigation menu I get the error at the bottom. Any
ideas why I get the permission problem?

-Tim

com.jniwrapper.win32.com.ComException: COM object method returns error
code: 0x80070005; E_ACCESSDENIED (Access is denied.)
at
com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:
658)
at
com.jniwrapper.win32.mshtml.impl.IHTMLElementImpl.getAttribute(SourceFile:
69)
at com.jniwrapper.win32.ie.dom.c.b(SourceFile:155)
at com.jniwrapper.win32.ie.dom.c.getAttribute(SourceFile:136)
at com.jniwrapper.win32.ie.dom.c.getText(SourceFile:417)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.jniwrapper.win32.ie.dom.j.run(SourceFile:591)
at com.jniwrapper.win32.MessageLoopThread
$ThreadSynchronizedAction.run(MessageLoopThread.java:560)
at com.jniwrapper.win32.MessageLoopThread
$LoopThread.run(MessageLoopThread.java:502)

Anson

unread,
Mar 26, 2007, 7:55:53 PM3/26/07
to watij
There are several other known issues with Watij and IE7, so I must say
I'm surprised that you could get that far, even.

-aB

Tim Wisniewski

unread,
Mar 27, 2007, 8:49:01 AM3/27/07
to watij
I just thought I would reply back to the list. Good news! I fixed
the problem. The site makes heavy use of javascript, and my theory is
the javascript was still executing while it was trying to click links
and such. The solution is to pepper your tests with

ie.waitUntilReady() // i think that is the call, not looking at the
code right now

calls before continuing at key points in the testing.

On Mar 26, 7:55 pm, "Anson" <ans...@gmail.com> wrote:
> There are several other known issues with Watij and IE7, so I must say
> I'm surprised that you could get that far, even.
>
> -aB
>
> On Mar 25, 3:37 pm, "Tim Wisniewski" <tjw3...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I'm using watij with IE 7. The site is rather complex with frames and
> > such. There is a navigation menu at the top. When watif "clicks" on
> > a link from the navigation menu I get the error at the bottom. Any
> > ideas why I get the permission problem?
>
> > -Tim
>
> > com.jniwrapper.win32.com.ComException: COM object method returns error
> > code: 0x80070005; E_ACCESSDENIED (Access is denied.)
> > at

> > com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(Sour­ceFile:


> > 658)
> > at
> > com.jniwrapper.win32.mshtml.impl.IHTMLElementImpl.getAttribute(SourceFile:
> > 69)
> > at com.jniwrapper.win32.ie.dom.c.b(SourceFile:155)
> > at com.jniwrapper.win32.ie.dom.c.getAttribute(SourceFile:136)
> > at com.jniwrapper.win32.ie.dom.c.getText(SourceFile:417)
> > at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> > at com.jniwrapper.win32.ie.dom.j.run(SourceFile:591)
> > at com.jniwrapper.win32.MessageLoopThread
> > $ThreadSynchronizedAction.run(MessageLoopThread.java:560)
> > at com.jniwrapper.win32.MessageLoopThread

> > $LoopThread.run(MessageLoopThread.java:502)- Hide quoted text -
>
> - Show quoted text -

Anson

unread,
Mar 27, 2007, 7:15:46 PM3/27/07
to watij
Tim-

Wow, you're doing a lot better with IE7 than most of us. What
operating system (please be specific, including service packs) are you
running it on?

You're probably right about the javascript; does it execute
asynchronously?

-aB

Alejandro Soini

unread,
Mar 27, 2007, 7:25:57 PM3/27/07
to wa...@googlegroups.com
I use watij with IE7 and need to get child browsers, modal dialogs, custom activeX controls, and open up microsoft excel all within junit tests.  the webapp uses javascript and vbscript.  Had a few bumps here and there, but nothing without a workaround solution.  the tool is pretty fantastic overall.

I did find though, that in certain cases, watij is a lot faster than some client-side vbscript (and javascript).  Most of the times, calling a waituntilready method was fine on the ie object, but there were some times where I had to sleep a thread for a bit (watij had to wait for client-side scripts to catch up).  The engineers here tend to hate my sleeping thread solution though.  There are other possible ways i'm sure, like refreshing in a while loop and checking for a particular html element's style (if it changes after client-side code finishes executing). 

Just some ramblings.  Mid afternoon lull.

Alejandro Soini

unread,
Mar 27, 2007, 7:26:40 PM3/27/07
to wa...@googlegroups.com
btw, the comfyj part is great for interfacing with excel or other com programs.  really like it.

Alejandro Soini

unread,
Mar 27, 2007, 7:31:31 PM3/27/07
to wa...@googlegroups.com
...but yeah, oops (de-reail'd!), waituntilready will probably be fine, unless the client-side script is very heavy and the page dom loads very quickly.

Taquitos!

unread,
Mar 28, 2007, 10:12:25 AM3/28/07
to watij
For reference, I have been using watij with IE7 on WinXP Pro with the
most current patches and had only very minor issues. The biggest
issue I get is that IE takes a minute or 2 to open.

Alejandro Soini

unread,
Mar 28, 2007, 2:31:57 PM3/28/07
to wa...@googlegroups.com
Yeah, I had to account for that problem too in successive test runs.  IE7 takes a while to open and close on somewhat slower machines (not a problem on 64bit nice machines).  Had to do some thread sleeping on logout/closing IE before the next successive junit/watij test would start up.  Unfortunate.

Tim Wisniewski

unread,
Mar 28, 2007, 4:02:52 PM3/28/07
to watij
Hello,

I started this thread and I'm trying to respond to some of you :)

I'm using Watij 3.1.0, jre 1.5.0.10, and WinXP home with all updates
installed. I'm not quite sure if the javascript is synchronous or
not. I'm using Watij for something a little different than it was
intended. I'm using it to log into a public website and do stuff for
me.

-Tim

On Mar 28, 2:31 pm, "Alejandro Soini" <alejoso...@gmail.com> wrote:
> Yeah, I had to account for that problem too in successive test runs. IE7
> takes a while to open and close on somewhat slower machines (not a problem
> on 64bit nice machines). Had to do some thread sleeping on logout/closing
> IE before the next successive junit/watij test would start up. Unfortunate.
>

> On 3/28/07, Taquitos! <taqui...@gmail.com> wrote:
>
>
>
>
>
> > For reference, I have been using watij with IE7 on WinXP Pro with the
> > most current patches and had only very minor issues. The biggest

> > issue I get is that IE takes a minute or 2 to open.- Hide quoted text -

Taquitos!

unread,
Mar 30, 2007, 7:49:21 AM3/30/07
to watij
If I am not wrong, that's what it has been designed for... the
ability to go to a website (public, private, yours, someone else's)
and do stuff. It can automate tedious tasks for you, it can be used
for testing web interfaces, or a boat load of other things (I use it
sometimes to generate a bunch of database traffic through my co's web
interface). Watij is really open and super useful!

yaXay

unread,
Mar 30, 2007, 2:53:26 PM3/30/07
to wa...@googlegroups.com
I thought I better clear this one up: This has very little to do with
JavaScript. The fact is that when you access the DOM to click somewhere,
the page may not have completely loaded. When you try accessing a frame
which has not yet loaded completly you might get an "Access Denied"
Exception.
This is reproducable with JavaScript, just reload a frame repeatedly and
try accessing it's window property.

With kind regards
Ben Schulz

Reply all
Reply to author
Forward
0 new messages