5 Replies Last post: Jul 7, 2008 5:35 AM by jeff  
jeff Beginner 6 posts since
Jun 30, 2008
Currently Being Moderated

Jul 4, 2008 8:36 AM

How do debug Javascript code from a Selenium Java Junit test?

Hello all,

 

I'm being driven nuts by Selenium at the moment, I hope someone out there can help me.

 

My test run fine from the Selenium IDE, but not when calling it directly from Java code.

 

I know the problem is somewhere in my JS code. Specifically when making a calls to...

 

getElementsByName

and

getElementById

 

They both result in the method calls never returning.

 

I think its a combination of cross script browser problem & selenium starting up my app in a frame.

(and maybe Selenium trying to be smart and find my property in a sub frame and looping off to infinite)

 

I would love to use a JS debugger like Venkman, but its not enabled as a Add-on when Firefox is started up from Java.

So how do I enable it?

 

Thanks

Jeff Porter

Andras Hatvani Almighty 567 posts since
Oct 16, 2006
Currently Being Moderated
1. Jul 5, 2008 3:20 AM in response to: jeff
Re: How do debug Javascript code from a Selenium Java Junit test?

Hello,

 

the thread title doesn't match your real problem, because it's about using prepared

Firefox profiles.

 

"-firefoxProfileTemplate <dir>: normally, we generate a fresh empty Firefox profile every time we launch. You can specify a directory to make us copy your profile directory instead."

as in http://selenium-rc.openqa.org/options.html.

 

Andras

p.s. It would be nice if you could use the search feature of the forum as this question has been posted very often.

Andras Hatvani Almighty 567 posts since
Oct 16, 2006
Currently Being Moderated
4. Jul 7, 2008 5:14 AM in response to: jeff
Re: How do debug Javascript code from a Selenium Java Junit test?

You should not get this error if you use Selenium via Chrome (*chrome).

 

Andras

More Like This

  • Retrieving data ...