Forum Discussion
I'm not sure I understand the question.
So, in your test code, you alter values in the grid from the default values. Those default values are stored in a variable. And you want to return the grid back to the defaults?
It sounds like simply writing some sort of looping code to go through the values of the stored grid and set the "live" grid to those values. Unless there's some complexity that is not coming through in your question.
It would be helpful to see the code that you are executing, perhaps the variable declaration you made, information about what type of grid it is, etc.
So, I have a tableGrid that has the column "DATE" and in the line with the information I leave as default "D + 0", for example, at runtime, I do the handling of this expression and add the current date or conform The parameter (D + 0 = today, D + 1 = one more day ...). But, for example, I want you to change that date to the current date, back to D + 0. Again with the value D + 0 and not 2017/03/01.
But in the properties of TableGrids I did not find any information to reset to default values. It is possible?
- tristaanogre8 years agoEsteemed Contributor
I'm assuming TableGrid is the component of your application? Or is it a variable in TestComplete?
If the former, that's out of the realm of possibility for TestComplete. If the method doesn't exist, you need to do the reset manually using some sort of code unit to do the reset.
As for the latter... when you exit the project, if it's a temporary variable, it will reset to defaults at the beginning of your next test run.- KorpTestComplet7 years agoNew Contributor
I was able to change the value at runtime.
this is my procedure:
//Danilo Casassa - 26/10/2017 // rotina para comparar Tables com Grids procedure CompareGridWithTablesGrids(tableGrid, grid : OleVariant); var indexRow, indexCol : integer; valorTable : OleVariant; begin //valida se a descrição está vazia if (vartostr(tableGrid.Description) = '' )then Indicator.PushText('Realizando validação da grid...') else Indicator.PushText(vartostr(tableGrid.Description)); //recebe o mapeamento da grid que esta sendo comparada tableGrid.ObjectName := VarToStr(grid); //percorre as linhas do tableGrid for indexRow := 0 to tableGrid.RowCount -1 do begin //percorre as colunas da tableGrid for indexCol := 0 to tableGrid.ColumnCount -1 do begin //pega o valor da table valorTable := tableGrid.Values[indexRow, indexCol]; //converte a se o valor da tablegrid for uma expressão valorTable := ConvertDateInDataBaseFormat(ValidateExpressionData(valorTable)); //Grid recebe o valor convertido tableGrid.Values[indexRow,indexCol] := valorTable; end; end; //Checa se os registros da Table estão de acordo com os da grid tableGrid.Check; Indicator.PopText(); end;
I'm don't get value of the tableGrid as variable, but now I can with this code.
Thanks.
Related Content
- 5 years ago
- 2 years ago
- 11 months ago
Recent Discussions
- 2 days ago
- 3 days ago