RE: [webdriver] Debugging

503 views
Skip to first unread message

Mark Collin

unread,
Jul 5, 2012, 7:29:16 AM7/5/12
to webd...@googlegroups.com

Have to switched to the iframe first?

 

Can you show us your test code?

 

From: webd...@googlegroups.com [mailto:webd...@googlegroups.com] On Behalf Of bensullivan
Sent: 05 July 2012 11:05
To: webd...@googlegroups.com
Subject: [webdriver] Debugging

 

Hi

I am having a problem clicking a link in an iframe on a page I am trying to automate the testing for.

I can see the element is resolved via a sysout statement but for some reason the click() method is not taking effect in the browser - this happens for both Firefox and IE.

Could someone indicate the most effective ways to debug WebDriver to ascertain what's going on?

Can I switch on some more verbose logging somewhere?

If I am using the IE driver do I need to debug the code in the IE driver server (gulp)?

Are there any nuances with the click method when iframes are involved?

Many thanks

Ben

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/YP0bInRABBgJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

bensullivan

unread,
Jul 5, 2012, 7:43:31 AM7/5/12
to webd...@googlegroups.com
Yeah - I switch to the right frame.  I find the element and call getText just to make sure it's what I expect - I appear to have the right element but then when I call click() on that element, nothing appears to happen.

How does the IEDriverServer trigger the click on a hyperlink?

It's something about the particular page I am on - as I'm fine logging into the app and navigating through...  Maybe a JavaScript nuance...

I would show test code but I forgot to commit before I left work :(

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

Jim Evans

unread,
Jul 5, 2012, 9:52:43 AM7/5/12
to webd...@googlegroups.com
There are occasions where the IE driver will miscalculate the coordinates to click in some frame/iframe scenarios. You can enable logging in the IE driver in the Java language bindings by using an instance of the InternetExplorerDriverService passed into the constructor of the InternetExplorerDriver class. You can get the service by doing something like:

    InternetExplorerDriverService service = InternetExplorerDriverService.Builder
      .usingAnyFreePort()
      .withLogFile(new File("somefile.log"))
      .withLogLevel(InternetExplorerDriverLogLevel.DEBUG)
      .build();

Unfortunately, this will only work in the local IE driver case; we haven't enabled it in the RemoteWebDriver case yet. We're working on it, but just don't have it there yet.

--Jim

bensullivan

unread,
Jul 7, 2012, 4:05:46 AM7/7/12
to webd...@googlegroups.com
THanks Jim.

Is there an equivalent mechanism for the FirefoxDriver (which appears to be exhibiting the same behaviour)?

Cheers

Ben

Jim Evans

unread,
Jul 7, 2012, 6:11:56 AM7/7/12
to webd...@googlegroups.com
Sorry, no. There's no analogous method for the Firefox driver that I'm aware of, though I'm sure someone will correct me if I'm wrong.

Krishnan Mahadevan

unread,
Jul 7, 2012, 6:21:46 AM7/7/12
to webd...@googlegroups.com
Jim,
Would this be something that can be used for enabling logs for FirefoxDriver?


Getting output from the Firefox process itself

This is usually useful to debug issues with Firefox starting up. The Java system property webdriver.firefox.logfile will instruct the FirefoxDriver to redirect the output to a file:

java -Dwebdriver.firefox.logfile=/dev/stdout -cp selenium-2.jar <sometest>

On Saturday, July 7, 2012, Jim Evans wrote:
Sorry, no. There's no analogous method for the Firefox driver that I'm aware of, though I'm sure someone will correct me if I'm wrong.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/6Jt1cOhc4usJ.

To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.



--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

bensullivan

unread,
Jul 8, 2012, 7:27:21 PM7/8/12
to webd...@googlegroups.com
OK thanks anyway.


Do you see anything wrong with it?

Thanks

Ben

bensullivan

unread,
Jul 8, 2012, 9:26:09 PM7/8/12
to webd...@googlegroups.com
Hi Mark


Thanks

Ben

On Thursday, July 5, 2012 9:29:16 PM UTC+10, Mark Collin wrote:

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

bensullivan

unread,
Jul 8, 2012, 11:10:15 PM7/8/12
to webd...@googlegroups.com
Hi Jim

The code you posted below doesn't seem to be compatible with my version of selenium 2 (2.24.1).

In my version of WebDriver, the methods you use are instance methods which can't be called statically as you have done.

Also, the InternetExplorerDriverLogLevel class does not exist.

And the InternetExplorerDriver constructor options only take either a port or a Capabilities instance.

What version of WebDriver are you using?

Cheers

Ben

Mark Collin

unread,
Jul 9, 2012, 5:41:43 AM7/9/12
to webd...@googlegroups.com

I can’t see anything drastically out of place, Your best bet is to continue your discussion with Jim, he wrote the IE driver and works for salesforce so is pretty much an expert in every aspect J

 

From: webd...@googlegroups.com [mailto:webd...@googlegroups.com] On Behalf Of bensullivan
Sent: 09 July 2012 02:26
To: webd...@googlegroups.com
Subject: Re: [webdriver] Debugging

 

Hi Mark

 

 

Thanks

 

Ben

On Thursday, July 5, 2012 9:29:16 PM UTC+10, Mark Collin wrote:

Have to switched to the iframe first?

 

Can you show us your test code?

 

From: webd...@googlegroups.com [mailto:webd...@googlegroups.com] On Behalf Of bensullivan
Sent: 05 July 2012 11:05
To: webd...@googlegroups.com
Subject: [webdriver] Debugging

 

Hi

I am having a problem clicking a link in an iframe on a page I am trying to automate the testing for.

I can see the element is resolved via a sysout statement but for some reason the click() method is not taking effect in the browser - this happens for both Firefox and IE.

Could someone indicate the most effective ways to debug WebDriver to ascertain what's going on?

Can I switch on some more verbose logging somewhere?

If I am using the IE driver do I need to debug the code in the IE driver server (gulp)?

Are there any nuances with the click method when iframes are involved?

Many thanks

Ben

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/YP0bInRABBgJ.
To post to this group, send email to webd...@googlegroups.com.

To unsubscribe from this group, send email to webdriver+...@googlegroups.com.


For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

--

You received this message because you are subscribed to the Google Groups "webdriver" group.

To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/l9eI1U0-x8gJ.


To post to this group, send email to webd...@googlegroups.com.

To unsubscribe from this group, send email to webdriver+...@googlegroups.com.

bensullivan

unread,
Jul 9, 2012, 6:33:49 AM7/9/12
to webd...@googlegroups.com
He works for salesforce??!!! Sweet!!!  He's my man...

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.


For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/l9eI1U0-x8gJ.
To post to this group, send email to webd...@googlegroups.com.

To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

bensullivan

unread,
Jul 9, 2012, 6:43:29 AM7/9/12
to webd...@googlegroups.com
Hi Jim

Mark Collin mentioned you worked for SalesForce?  My issue is with a BigMachines iframe running inside Salesforce.  We have a "New Quote" button on the Opportunities tab which then displays a BigMachines iframe for an Edit Quote page.  This is the page where I am unable to click any buttons.

Strangely enough, our BigMachines onsite consultant has got it to work through the Selenium IDE.  Do you know how the IEDriver and Selenium IDE implementations differ (other than the obvious).

Cheers

Ben 


On Thursday, July 5, 2012 11:52:43 PM UTC+10, Jim Evans wrote:

Jim Evans

unread,
Jul 9, 2012, 7:04:02 AM7/9/12
to webd...@googlegroups.com
I should have prefaced my code sample with a big, honkin', "WARNING: Untested code written off the top of my head without the benefit of an IDE." I was sure those classes Java were available in the 2.24.1 Java bindings, but I frequently work from the latest trunk, so I allow that the use of the builder class for the IE driver service may not be available until 2.25 (coming soon!). I honestly can't remember when those changes were checked in. Mea culpa.

Jim Evans

unread,
Jul 9, 2012, 7:06:55 AM7/9/12
to webd...@googlegroups.com
Let's take this internal. I'll be in the office in a couple of hours, and we can chat then.

bensullivan

unread,
Jul 9, 2012, 7:18:13 AM7/9/12
to webd...@googlegroups.com
OK thanks

bensullivan

unread,
Jul 9, 2012, 4:46:24 PM7/9/12
to webd...@googlegroups.com
Hi Jim

Did you get my email?

Thanks

Ben

Jim Evans

unread,
Jul 9, 2012, 5:38:19 PM7/9/12
to webd...@googlegroups.com
Yep, thanks. I'll see what I can do to help out.

bensullivan

unread,
Jul 9, 2012, 7:28:11 PM7/9/12
to webd...@googlegroups.com
That's awesome thanks mate
Reply all
Reply to author
Forward
0 new messages