Ask a Question

Insert on whole number in datadriver

renatoveronese
New Contributor

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 4
Marsha_R
Community Hero

Re: Insert on whole number in datadriver

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
New Contributor

Re: Insert on whole number in datadriver

@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
Community Hero

Re: Insert on whole number in datadriver

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?

renatoveronese
New Contributor

Re: Insert on whole number in datadriver

@Marsha_R

 

When i put on break point in the key line, the double click select the actual price of the textbox (0,00) the pattern.

But in the key of insert the value (5), the test complete insert the value 0,05, not 5..

The double click has the way i've found to " delete" the actual value in the textbox (0.00) and insert one new ( 5 ) , but this do not work...

 

cancel
Showing results for 
Search instead for 
Did you mean: