IUIContext setFocus method goes missing

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

IUIContext setFocus method goes missing

Postby sagar.shg » Mon Apr 26, 2010 3:25 am

Hi,

I'm using Window tester 5.0 on eclipse 3.5. My test suite reports that the method setFocus(LabeledTextLocator) is undefined for the type IUIcontext. :(
Do we have any other alternative available??

-Sagar.
sagar.shg
 
Posts: 13
Joined: Tue Nov 17, 2009 10:22 pm

Re: IUIContext setFocus method goes missing

Postby Phil Quitslund » Mon Apr 26, 2010 7:57 am

Right! That method was deprecated and finally removed. To update your tests to the new API change these calls to look like this:

Code: Select all
ui.ensureThat([locator].hasFocus());

The good news is you can do this automatically with our API migration tooling. The tooling and changes are described here:

http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/reference/API%20Migration_0.html
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: IUIContext setFocus method goes missing

Postby sagar.shg » Tue Apr 27, 2010 2:58 am

Phil,

Thanks for providing the migration tool, it did help in migrating some files. I have observed that once migrated errors still persists in the file i.e. a few migrated APIs are shown in error.

Prev version: ui.setFocus(widgetLocate)
New version: ui.ensureThat(widgetLocate.hasFocus())

Please note widgetLocate is of type IWidgetLocator for which hasFocus method is not defined. I had to manually update this code.

There are several other places where manual upgrade would be required.

Also, I have faced this issue as well: viewtopic.php?f=5&t=4862
sagar.shg
 
Posts: 13
Joined: Tue Nov 17, 2009 10:22 pm

Re: IUIContext setFocus method goes missing

Postby Phil Quitslund » Tue Apr 27, 2010 8:37 am

Thanks for following up. We're still working on refining our API migration tooling so your comments are really handy.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest