Check existence

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

Check existence

Postby nestra » Wed Feb 16, 2011 1:18 am

Hello everybody!

how can I do to check the existence of an object in x, y coordinate?

Or, how can I do to check if a (specific) object has been clicked on in the window?

Thanks!

ps: this object isn't a widget
nestra
 
Posts: 3
Joined: Thu Feb 10, 2011 2:00 am

Re: Check existence

Postby keertip » Wed Feb 16, 2011 8:26 am

Could you elaborate some more? What do you mean when you say it is not a widget?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Check existence

Postby nestra » Wed Feb 16, 2011 11:33 pm

It's a org.eclipse.draw2d.IFigure object.
But i find a solution:

Code: Select all
IWidgetLocator[] liste = ui.findAll(type);

for (int j = 0; j < liste.length; j++)
    {
      FigureReference serv = (FigureReference) liste[j];
      IFigure f = serv.getFigure();
      if (f.getBounds().x == xy.x() && f.getBounds().y == xy.y())
        return liste[j]; // object in x,y
    }



Howewer, how to get all the selected object? For exemple, get values from the selected widget.
nestra
 
Posts: 3
Joined: Thu Feb 10, 2011 2:00 am

Re: Check existence

Postby keertip » Tue Feb 22, 2011 8:50 am

Glad that you could solve the problem. Once you have the widget, you should be able to get the values from the widget.
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

cron