Go Back   SmartClient Forums > Smart GWT Technical Q&A
Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #21  
Old 26th Oct 2009, 12:05
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default

Good to know. Thanks for the tip.

As I get time, I might dig into this more. I'm new to these tools, so I don't even know at this point how to get any js other than the user-extentions.js plugged into the testing framework.

I'll be sure to update this list if/when I make any progress on this. No promises though.

TT
Reply With Quote
  #22  
Old 26th Oct 2009, 12:34
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 14,182
Default

Note that the functionality in AutoTest.js is already present in ISC_Core.js, at least for smartclientSDK (as opposed to smartclientRuntime).
Reply With Quote
  #23  
Old 27th Oct 2009, 05:52
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default

Also good to know. Not sure how that helps at this point. It seems Selenium is running in one window/frame and my app in another. SmartClient libraries are not available in Selenium (where I need to make use of AutoTest), and I cannot find a way to load them there. So, I think it is ugly, but I can expose my app's global object like I said before so that in user-extentions.js I can do something like this:

Code:
isc = inDocument.globalObj.isc; isc.AutoTest.getElement(...

BUT, If you could provide a bit more details on how to use AutoTest, it would be very helpful. Consider...

In the user-extentions.js I uploaded previously:
Code:
// Returns the <input> element inDocument.globalObj['userName'].getDataElement() // Clicks the SmartClient button inDocument.globalObj['logonButton'].click()

But, I am guessing you are suggesting doing code like the following instead?
Code:
isc.AutoTest.getElement(isc.AutoTest.getLocator(inDocument.globalObj['userName'])) // This returns null, not the <input> I expected isc.AutoTest.getElement(isc.AutoTest.getLocator(inDocument.globalObj['logonButton'])).click() // this returns a div (in FF anyway), which does not have a click() method

Last edited by ttubbs : 27th Oct 2009 at 07:33.
Reply With Quote
  #24  
Old 29th Oct 2009, 06:41
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default

bump bump bump
Reply With Quote
  #25  
Old 8th Nov 2009, 05:24
taxaw taxaw is offline
Registered Developer
 
Join Date: May 2008
Posts: 29
Default A progress ?

Quote:
Originally Posted by ttubbs
bump bump bump
ttubbs, i didn't see that there was a progress in this thread.
I don'nt have enough skill in Javascript but i'm going to improve my knowledge in order to make Smartgwt compliant to selenium, if possible.

Where can we download or have documentation on autoTest.js ?

For the user-extentions.js file, what version of selenium do you use ?

I need to have the same environnement than you so i can participate.
Thank you.
Reply With Quote
  #26  
Old 9th Nov 2009, 13:42
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default I don't know where to go next.

AutoTest.js is inside the LGPL version of SmartClient
I downloaded selenium-remote-control-1.0.1-dist.zip.

I am just not able to click on an element using my current setup (FitNesse, WebTest, Selenium RC, SmartClient). I experimented with the stuff in AutoTest, and did make some progress, but it is SmartClient specific code that I don't really like needing to do. (Finding eventproxy or looping up parentElements to find a subcomponent such as the close button on a window). Just ugly code.

I should be able to send a click event to an element on the page just as if I am clicking the mouse there. I've put traces in my Selenium user-extentions.js, and can see that the same elements I click with the mouse are being sent a click event as well. The app just sits there and doesn't do a thing.

Another guy on the team has been working with Googles WebRunner (which looks to use Selenium under the covers, thought he inports are not the same package names). He is able to get a button or grid cell element (both <td>s) send them a click() message, and the app responds as expected. He's using this to run JUnit tests.

I don't know what Voodoo is being done in WebRunner that makes a click on the same dang elements work there but not for me in WebTest/Selenium RC.

I guess I'll have to see if WebRunner source is available and see what they are doing in their click method.

It seems SmartClient triggers alot of stuff off of mouseUp instead of click, so maybe something to explore there.
Reply With Quote
  #27  
Old 9th Nov 2009, 15:29
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 14,182
Default

AutoTest.js has two very very simple, elegant APIs you should use, the previously mentioned getLocator(element) and getElement(locator). All of the rest is internal concerns of the framework, that's the whole point.

If Selenium takes shortcuts and does not simulate a true click (mouseDown, mouseUp, click) then yes most SmartClient elements will not respond to that. So that may well be the problem. Perhaps you can find a setting to enable true event series to be sent.
Reply With Quote
  #28  
Old 10th Nov 2009, 05:05
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default WebDriver (not WebRunner)

First, I lied. The Google product is called WebDriver (not WebRunner).

Second, it seems that there has been some chatter on OpenQA for over a year about merging WebDriver and Selenium. I cannot find that this has happened yet. However, there is something called SpiderFixture, a WebDriver backed fixture for FitNesse (which is what I am mostly interested in). I plan to explore that combo some to see if it makes things easier going.

As a test, I intercepted the 'click' event in my user-extentions.js fiile, and manually sent a 'mousedown', 'mouseup', and 'click'. This did improve things slightly, it made my button show in a focused and selected state. However, the click still did not process.

I've attached my latest user-extensions.js for any who care.
Attached Files
File Type: js user-extensions.js (8.1 KB, 28 views)
Reply With Quote
  #29  
Old 10th Nov 2009, 11:54
ttubbs ttubbs is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 62
Default Good News - I Think...

I have had some success today using a different mix of tools:
FitNesse, FitLibrary, FitLibraryWeb (SpiderFixture), WebDriver

After much trial and error (the docs are not so good for a newbie), I have been able to get something to click in my SmartClient app.

I downloaded the latest libraries listed above. The SpiderFixture is backed by WebDriver, and since we had success with that in JUnit, I thought I'd give it a try for FitNesse. It did not process the click as I expected it would. Again, after much trial and error, I discovered that the version of WebDriver packaged with FitLibraryWeb is older than the one we are using in the JUnit tests. I copied over the newer version into my FitNesse lib folder, and like magic I can click on elements.

At this point, I think I am going to explore with this set of tools and leave off where I was with the Selenium stuff. But, I've got a new assignment that is going to keep me out of testing for a few weeks to a month. I'll be sure to provide any updates in the future should I have any more to give.

Thanks & Good Luck All,
TT
Reply With Quote
  #30  
Old 12th Nov 2009, 19:19
chetan.phanse chetan.phanse is offline
Registered Developer
 
Join Date: Jul 2009
Posts: 17
Default ButtonItem

Yeah it would be great if we had a setID with each selenium widget.

Do we have a way to trap buttonItem. Precisely I want to click a buttonITem widget.
I wasnt also able to get a handle to the form element even after setting the ID tag.

Any help would eb really appreciated
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


©2006 Isomorphic Software   ·   Terms of use