Saturday, June 4, 2011

Re: Simulating button click in GWT Unit test?

Shouldn't this test be an acceptance test run by something like selenium, instead of using GWTTestCase?

On Sat, Jun 4, 2011 at 10:51 AM, Ed <post2edbras@gmail.com> wrote:
I have to simulate a button click on a button that is created in a GWT
Unit test (that extends from GWTTestCase).
However, it's almost impossible to get a direct reference to the
button to simulate the click directly on the button event.

The button, however, has a unique id through the HTML tag id property.
Is there away to find the button element and then simulate the button
click in a GWT Unit test ?

I am not sure how to do this.
Finding the element through "Document.get().getElementById("bla")" I
don't think works as RootPanel.get() doesn't contain the expected
application elements but rather GWT Junit stuff...? :(
And then how to simulate a button click on the found element :(...

Please some advice?
- Ed

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
Magno Machado Paulo
http://blog.magnomachado.com.br
http://code.google.com/p/emballo/

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment