Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Announcing early WebDriver-like framework for SWT Browser object; feedback/comments appreciated

Good start, keep up the work.  I've written something a bit more complex than this for commercial applications.  I'll be interested to see if you take a different approach if/when you expand this.  

In particular, having hooks to know when a page is finished with what it's doing (AJAX requests, DOM changes, etc in the face of timeouts and intervals) is a harder problem.  SWT has no native handling of these internal JS workings and doesn't report progress events or anything.  Selenium approaches this by putting in timing waits generally, but this is one thing that makes Selenium a bitch to work with for more complex web apps.  In addition, SWT currently offers no way to block popups without disabling Javascript and it's prompt handling in general is pretty absent (see my bug 288037).  These things plus a couple more small ones make it hard to work with SWT like this for a total automated testing solution.

To work around these issues, I've generally had to drop into Mozilla's XPCOM to get the extra event hooks, so I lose any cross-browserness.  I doubt you'd go there given the direction of the code currently, but it'll be good to see if you come up with a more general solution I missed to some of these issues.

Ryan Levering

On May 9, 2010, at 11:35 PM, Misha Koshelev wrote:

> Dear All:
> 
> I have been working on some end-used web automation projects, and have, in the process, developed some code to (partially) implement a WebDriver-like framework for the SWT browser objects.
> 
> The WebDriver browser automation framework 
> http://code.google.com/p/selenium/
> works quite well for web site testing. However, for end-user Web automation applications, where it is desirable to hide the browser window, it is not possible (on all platforms) to use this framework.
> 
> On the other hand, the SWT Browser object 
> http://www.eclipse.org/swt/
> http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html
> allows execution of arbitrary JavaScript code on a _native_ browser without any constraints as to its visibility.
> 
> Although it is possible to write a formal WebDriver driver for the SWT Browser, both projects are rather large. Rather, I have, so far, implemented a subset of the WebDriver functions for the SWT Browser Object using Javascript commands. There is much work to be done (e.g., xpath support). However, as proof of concept, I have implemented a simple Web Automation App for Facebook, as well as a Javascript Viewer that allows one to view the results of Javascript commands that return HTML Elements or lists of elements.
> 
> I have posted my early framework here under GPLv2:
> http://www.mkosh.com
> 
> I am very interested in contributing the org.swt.eclipse.browser.webdriver classes within my framework to the SWT framework. Please let me know if there is interest in this, and I can try to make these classes (i) more robust and (ii) in the format of patches to SWT trunk.
> 
> Thank you so much
> 
> Sincerely yours
> Misha Koshelev
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top