ui.setFocus(locator)

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

ui.setFocus(locator)

Postby Ali Anwar » Tue Mar 23, 2010 11:59 pm

Hi,

I switched to window Tester version 5.0 from 4.0 and there is no more ui.setFocus(locator). Whats the immediate replacement of it??

Thanks,
Ali
Ali Anwar
 
Posts: 8
Joined: Wed Dec 02, 2009 9:31 pm

Re: ui.setFocus(locator)

Postby keertip » Wed Mar 24, 2010 2:06 pm

Instead of a ui.setFocus(locator) you would do a

ui.ensureThat( locator.hasFocus());
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: ui.setFocus(locator)

Postby Phil Quitslund » Wed Mar 24, 2010 3:52 pm

Easier still, check out our API migration tooling:

http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/reference/API%20Migration.html

To convert API, select a project, package or Java resource and choose the WindowTester Tools > Convert to new WindowTester API action from the context menu.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: ui.setFocus(locator)

Postby Ali Anwar » Wed Mar 24, 2010 10:22 pm

It seems that method hasFocus is undefined for the for type IWidgetLocator.
Ali Anwar
 
Posts: 8
Joined: Wed Dec 02, 2009 9:31 pm

Re: ui.setFocus(locator)

Postby keertip » Fri Mar 26, 2010 8:19 am

Yes, that is correct. The method hasFocus in not implemented for the generic IWidgetLocator. Take a look at

http://downloads.instantiations.com/Win ... Focus.html

to see which locators do implement hasFocus.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest