javierdotnet / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
1 stars 3 forks source link

Canoot test GWT-Ext with Selenium #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download selenium from http://www.openqa.org/selenium,
http://www.openqa.org/selenium-ide/ and
http://wiki.openqa.org/display/SEL/waitForCondition
2. run in host mode and start the selenium IDE from firefox. Then record
test for FeedViewer. I try to click "Add Feed" button at the upper left
conner, then select any feed and confirm by the "Add Feed" button.
3. replay the test and fail.

What is the expected output? What do you see instead?
With normal GWT, I can use xpath to specify the locator of the GUI item.
Then I can successfully replay it in Selenium. However, I fail to do so in
application using GWT-Ext, coz GWT-Ext use Ext.generateId() to create ID
for all their GUI item (if we don't specify one). Hence, their ID is
dynamic and cannot be tested by any testing framework. In fact, this also
override the original behavior of GWT.

I think this is a problem because developer cannot create test case for
GWT-Ext application impact on a normal development flow.

What version of the product are you using? On what operating system?
0.9.1

Please provide any additional information below.

Original issue reported on code.google.com by raymond....@gmail.com on 20 Aug 2007 at 1:51

GoogleCodeExporter commented 9 years ago
Why don't to specify an ID for your UI elements created using GWT-Ext? Most of 
them
allow you to explicitly specify an ID. 

Original comment by sanjiv.j...@gmail.com on 20 Aug 2007 at 2:01

GoogleCodeExporter commented 9 years ago
Thank sanjiv.jivan,

As we are moving from GWT to start to use GWT-Ext, In case of GWT, we don't 
need to
specify any id for GUI component, it will automatically use the something that
similar to the following in the XPath of the GUI component.
div[36]/table/tbody/tr[2]/td/table/tbody/tr[3]/td/button

For some Ext component, we still don't know how to specify the ID for them. For
example.MessageBox and LayoutDialog.

Even if we can specify ID for all our GUI components, it will come up another 
naming
standard for GUI ID, which may create problem in the later development cycle.

Many thanks for your help. :)

Ray,

Original comment by raymond....@gmail.com on 20 Aug 2007 at 2:38

GoogleCodeExporter commented 9 years ago
I also see the same issue.
ANy answers to that Sanjiv.

Original comment by buddha...@gmail.com on 21 Jan 2009 at 3:02

GoogleCodeExporter commented 9 years ago
Please let me know if you found a solution to this problem of dynamic element 
ids in 
a GWT application. Were you able to test this with Selenium ?

thanks,
Shruti

Original comment by shruti....@gmail.com on 21 Sep 2009 at 6:50

GoogleCodeExporter commented 9 years ago
One suggestion is to put names in component and use it to locate the element 
with the selenium.

Original comment by marlon...@gmail.com on 8 Dec 2011 at 12:17

GoogleCodeExporter commented 9 years ago
You can use a combination of static-ids and (css-selectors or xpath-locators) 
to find and operate on elements.  One frustration with Ext-GWT is that it takes 
3 Selenium commands to simulate a mouse click within a grid (for example).  I 
believe it's something on: mouseover, mousedown, click.  Those 3 commands will 
get the correct user action to fire (I found that in the Sencha help forums - 
and, yes - I know this is a different project but I believe it is worth a shot 
if you've stumbled onto this thread).  

This is also helpful if you're not familiar with CSS Selector: 

http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selen
ium-demystified/ 

Original comment by andrew.l...@gmail.com on 8 Dec 2011 at 1:11