Problem to get instance of org.eclipse.swt.WidgetManager [message #657699] |
Thu, 03 March 2011 11:34  |
Eclipse User |
|
|
|
Im trying to test a RAP application with selenium.
To obtain information about the state of UI widgets, i will access the
org.eclipse.swt.WidgetManager to retrieve widgets by their id.
In the user-extensions-qooxdoo.js file i added the following function:
Selenium.prototype.getWidgetById = function(locator){
var uwindow = this.browserbot.getUserWindow();
var wmanager = uwindow.org.eclipse.swt.WidgetManager.getInstance();
// obtain reference to widget
widget = wmanager.findWidgetById(locator);
return widget != null;
}
In selenium IDE the following exception is thrown:
[error] Unexpected Exception: message -> wmanager.findWidgetById(locator) is undefined, fileName -> chrome://selenium-ide/content/tools.js -> file:///C:/iDARE.WEST/rap_UITest/scripts/user-extensions-qoo xdoo.js, lineNumber -> 115, stack -> ("userEmailTxt","")@chrome://selenium-ide/content/tools.js -> file:///C:/iDARE.WEST/rap_UITest/scripts/user-extensions-qoo xdoo.js:115 ("userEmailTxt","" )@chrome://selenium-ide/content/selenium/scripts/htmlutils.j s:60 ([object Object],[object Object])@chrome://selenium-ide/content/selenium/scripts/sele nium-commandhandlers.js:330 ()@chrome://selenium-ide/content/selenium/scripts/selenium-e xecutionloop.js:112 (1)@chrome://selenium-ide/content/selenium/scripts/selenium- executionloop.js:78 (1)@chrome://selenium-ide/content/selenium/scripts/htmlutils .js:60 , name -> TypeError
I also tried to get the WidgetManager directly using 'var wmanager = org.eclipse.swt.WidgetManager.getInstance()'. In this case a similar exception 'org is undefined' appeared. If i change 'this.browserbot.getUserWindow' in 'this.browserbot.getCurrentWindow' an exception 'getCurrentWindow().org is undefined' is thrown.
Has anybody an idea, how i can fix it?
Thanks in advance
[Updated on: Thu, 03 March 2011 11:40] by Moderator
|
|
|
|
|
|
Re: Problem to get instance of org.eclipse.swt.WidgetManager [message #658413 is a reply to message #657944] |
Tue, 08 March 2011 07:44  |
Eclipse User |
|
|
|
I solved the problem.
As you mentioned i got the reference to the WidgetManager correctly, but the function 'getValue()' is not defined for the widget type i tried to evaluate.
In a copy of the qooxdoo SDK i found a complete API documentation of the qooxdoo javascript widget implementation.
Thanks for your advice.
Christian
|
|
|
Powered by
FUDForum. Page generated in 0.24108 seconds