Forum Discussion

renatoveronese's avatar
renatoveronese
New Contributor
9 years ago

Insert on whole number in datadriver

Hi, i have one datadriver, the value in my table is an whole number (5).

But my textbox is in decimal number (0,00).

When my test complete execute the script, the insert value in my textbox is 0,05.

I want to insert the number that is in my datadriver (5).

When i fix it?

When i manually execute an double click in the textbox and insert the number 5, it's ok, the number continues in whole number. But the test complete don't execute the same test.

 

This is my actual script:

 

function SetValue(DadosValorGrupoPessoa)
{
  var txtBoxValueGroupPerson= Properties["GetTxtBoxValueGroupPerson"]();
  txtBoxValueGroupPerson["DblClick"]();
  txtBoxValueGroupPerson["Keys"](DadosValorGrupoPessoa);
}

 

///////////////////////////////////////////////////////////////////////////////////////////////////

 

function GetColDadosRendaGrupoPessoa(driver)
{
  return (VarToStr(driver["Value"](GetIndiceColDadosGrupoPessoaCommerceFood("RENDA"))));
}

 

/////////////////////////////////////////////////////////////////////////////////////////////////

 

function GetIndiceColDadosGrupoPessoaCommerceFood(coluna)
{
  switch(coluna)
  {
    case "RENDA":           return 6;
    break;

 

 

 

4 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Try using

     

    aqConvert.StrToInt(your table value here)

     

     

    or

     

    aqConvert.StrToFloat(your table value here)

     

    to make sure that the value being inserted with Keys is actually a number 

    • renatoveronese's avatar
      renatoveronese
      New Contributor

      @Marsha_R

       

      I tried to insert this code in my function, but don't it works.

      The Test Complete don't insert any number when i add this convert.

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        If you put a Pause on the Keys line, can you see what the double click has done?  Has it actually selected all the text in the field?