|
#1
|
|||
|
|||
|
Hi,
Can selenium testing tools be used with SmartClient/GWT ? With gwt-ext, i used to set the id of widget in order to have direct access to them from selenium command (locator). Is it possible to set id for all widget present in SmartClient/GWT ? Thanks. |
|
#2
|
|||
|
|||
|
SetId like with gwt-ext ?
|
|
#3
|
|||
|
|||
|
++
GWT widgets provide the method "ensureDebugId" which seems not to work with SmartGWT. Is there a chance of making the method workable with one of the next SmartGWT releases? Thanks! |
|
#4
|
|||
|
|||
|
Is anyone here familiar with Selenium at the code level? (or is willing to do a little digging). Basically in order to support Selenium, the function for
ID --> DOM lookup in Selenium needs to be overridden with a simple SmartClient specific function. Tools like Selenium IDE also support customization by pointing to a user defined JS file. My bandwidth is a little limited due to other tasks so if anyone can take the lead on this it would be great. Post here or email for details. Else I'll get to it in the order of priority relative to other tasks.. Thanks, Sanjiv |
|
#5
|
|||
|
|||
|
Should be easy. From what I've read you need to add the SC ID function to user-extensions.js
Something along the lines of Code:
|
|
#6
|
|||
|
|||
|
Quote:
I just did some experiments today. Apparently the problem is not the id but the trigger of events. That is I can (apparently) properly record all my actions, but when I rerun the tests while I'm seeing the fields correctly filled, my "clicks" are not working. Did someone find a solution? Using a 1000 bucks / mo. software is a no way, possibilities are somehow running tests in javascript or using some macro plugin and doing the checks manually. |
|
#7
|
|||
|
|||
|
See also this:
http://clearspace.openqa.org/message/56726 given that this is a pretty important requirement for us, do you would accept some patches to make gwt firebug friendly? I was thinking along the lines of putting a parameter somewhere to listen "soft" clicks from firebug. Not sure to understand well but maybe putting an optional (via the parameter) javascript onClick() listener on every canvas that fire a proper smartGwt click event. I'm looking at the Canvas.setupClickEvent() code |
|
#8
|
|||
|
|||
|
I found a workaround (for buttons) to be able to test with Selenium:
make sure to assign ID to your buttons; yourButton.setID("AddUserBtn"); then in selenium replace the XPath from the recorder (that use temporary id) with something like: //div[@eventproxy="AddUserBtn"]/table/tbody/tr/td and then replace click event with KeyPress using blank as Value. now it works fine. |
|
#9
|
|||
|
|||
|
Just a note that part of the underlying problem is that Selenium currently plays back a simplified event stream (click but not mouseup/mousedown). With other tools that do this, it's often possible to get a working record and playback by doing everything via the keyboard only when recording the test case.
|
|
#10
|
|||
|
|||
|
Isomorphic , The real problem is not about having a way to record actions and replay them. It's about having the possibility to write by hands selenium commands (Mouse down/Mouse Up are part of it) in order to simulate all end users actions.
Uberto found a way to click a button through selenium commands, and to identify uniquelly a button by calling the setID method. The question is : Is there a setID method for all SmartGWT widgets objects ? If yes it is possible to test SmartGWT with Selenium (not by recording and replaying but by writing the selenium commands directly) . For ext/ Gwt-ext, i've found a framework based on selenium which help greatly to write functional tests. Every Ext widget has its own way to be accessed : http://code.google.com/p/kdev-wtf/ Sory for my english. |