Need alternate method for setFocus

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

Need alternate method for setFocus

Postby sanjay d c » Wed May 25, 2011 2:16 am

Hi All,

I recently migrated from windowtester 3.9 to 6.0 .

doing this I am facing the below problem :

Cannot cast from void to WidgetReference

Windowtester 3.9 code :

WidgetReference ref = (WidgetReference) ui.setFocus(textLocate);

This works fine .

Windowtester 6.0 code :

WidgetReference ref = (WidgetReference) ui.ensureThat((textLocate).hasFocus());

with this code am getting "Cannot cast from void to WidgetReference". The result is obvious as ui.ensureThat will return Void (Nothing).
Could anyone please suggest any alternative to the above code.

sanjay d c
Posts: 3
Joined: Wed May 25, 2011 1:26 am

Re: Need alternate method for setFocus

Postby gnebling » Wed May 25, 2011 9:07 am

Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest