click() not working in IE while debugging (at least the first time)

29 views
Skip to first unread message

Jeff

unread,
May 6, 2011, 12:42:10 PM5/6/11
to webdriver
This is related to clicking a link <A> when using InternetExplorerDriver (with IE8).  Particularly when I'm debugging, the click() doesn't always work!!!  In the code below, I set a breakpoint on the first click() and run to that point.  I get the information about the anchor printed just fine, then when I step over the e.click() call, it doesn't do anything:.
 
    driver.get("https://www.familysearch.org");
    WebElement e;
    e = driver.findElement(By.id("sign-in-link"));
    System.out.println("href: " + e.getAttribute("href"));
    System.out.println("title: " + e.getAttribute("title"));
    System.out.println("text: " + e.getText());
    e.click();  //Breakpoint HERE then step over
 
It doesn't make ANY sense.  If I run it without a breakpoint, it seems to work.  The problem comes when I'm trying to debug other stuff ... if I end up having to step through code when a click is involved, it becomes a huge annoyance.
 
I then added a second call to e.click().  If I break on the first click, step over the first, then the second call to e.click() WORKS!  Why?
 
Anyone see something similar?
 
NetBeans 6.9.1 / Java 6 / Win7x64 / Selenium-2.0b3 / Firefox 3.6.17 / FirefoxWebDriver

--
I ♥ DropBox !! 

Jim Evans

unread,
May 6, 2011, 1:27:03 PM5/6/11
to webdriver
I know there's an issue with trying to send mouse clicks to an IE
window in the background. It doesn't happen 100% of the time, but the
problem happens at the level of the shared native event code. The
symptom is that the link receive the focus, but does not fully process
the click message. I know of no workarounds or fixes yet. Yes, it
makes the project frustrating to work with, and I'd be happy to accept
any patches fixing it, as long as they don't involve forcing the
browser window into focus.

On May 6, 12:42 pm, Jeff <predato...@gmail.com> wrote:
> This is related to clicking a link <A> when using
> *InternetExplorerDriver*(with IE8).  Particularly when I'm debugging,
> the click() doesn't always
> work!!!  In the code below, I set a breakpoint on the first click() and run
> to that point.  I get the information about the anchor printed just fine,
> then when I step over the e.click() call, it doesn't do anything:.
>
>     driver.get("https://www.familysearch.org");
>     WebElement e;
>     e = driver.findElement(By.id("sign-in-link"));
>     System.out.println("href: " + e.getAttribute("href"));
>     System.out.println("title: " + e.getAttribute("title"));
>     System.out.println("text: " + e.getText());
>     e.click();  *//Breakpoint HERE then step over*
>
> It doesn't make ANY sense.  If I run it without a breakpoint, it seems to
> work.  The problem comes when I'm trying to debug other stuff ... if I end
> up having to step through code when a click is involved, it becomes a huge
> annoyance.
>
> I then added a second call to e.click().  If I break on the first click,
> step over the first, then the second call to e.click() WORKS!  Why?
>
> Anyone see something similar?
>
> NetBeans 6.9.1 / Java 6 / Win7x64 / Selenium-2.0b3 / Firefox 3.6.17 /
> FirefoxWebDriver
>
> --
> Jeff Vincent
> predato...@gmail.com
> See my LinkedIn profile at:http://www.linkedin.com/in/rjeffreyvincent
> I ♥ DropBox <http://db.tt/9O6LfBX> !!

Jeff

unread,
May 6, 2011, 1:55:54 PM5/6/11
to webd...@googlegroups.com
It's on my list to learn how to build and debug the driver and any shared code.  At the risk of asking something that is possibly obvious (in my rush to do other things), is there a detailed resource to get me started down this path?


--
You received this message because you are subscribed to the Google Groups "webdriver" group.
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.




--
Jeff Vincent
preda...@gmail.com
I ♥ DropBox !! 

Bill Ross

unread,
May 6, 2011, 2:28:04 PM5/6/11
to webd...@googlegroups.com
> then when I step over the e.click() call, it doesn't do anything:.
> e.click(); *//Breakpoint HERE then step over*
> I then added a second call to e.click(). If I break on the first click,
> step over the first, then the second call to e.click() WORKS! Why?

If you step over, doesn't that mean you skip execution of that call?
Then you execute the doubled call if it's there.

Bill

Jim Evans

unread,
May 6, 2011, 2:50:15 PM5/6/11
to webdriver
I'd start with the project wiki[1] first, specifically the page on
building WebDriver[2]. If you have questions, I'd try the Selenium IRC
channel[3], or the selenium-developers mailing list[4].

Regards,
--Jim

[1] http://code.google.com/p/selenium/w/list
[2] http://code.google.com/p/selenium/wiki/BuildingWebDriver
[3] #selenium on Freenode
[4] http://groups.google.com/group/selenium-developers

On May 6, 1:55 pm, Jeff <predato...@gmail.com> wrote:
> It's on my list to learn how to build and debug the driver and any shared
> code.  At the risk of asking something that is possibly obvious (in my rush
> to do other things), is there a detailed resource to get me started down
> this path?
>

Jim Evans

unread,
May 6, 2011, 2:55:00 PM5/6/11
to webdriver
"Step over" as opposed to "step into". In most debuggers, "step into"
means, "execute without stepping into the source code of this method
call."
Reply all
Reply to author
Forward
0 new messages