You are here

Using the .SelectNext() or .SelectPrev() methods in TestComplete

When using the ".SelectNext()" or ".SelectPrev()" in TestComplete in can be nice to lgo the action result as a ChechPoint.
This is easily done as you can see in this sniplet below.


var Combobox= Aliases.Application.Grid.Grid2.UniformGrid.Grid2.Combobox;


// Set Experience Right
if(!Combobox.SelectNext())
{
Log.Checkpoint("The next item was selected");
}
else
{
Log.Error("The next item was NOT selected");
}

As you can see the return value is negated. This is done intentionally to make the code more readable. If you do not like this, you can log the Error in the if statement.