Page 1 of 1

Assigning values at runtime

Posted: Fri Mar 06, 2009 2:23 pm
by automationtool.1
Hi,
I want to write a value for text box at runtime, how can i do that?
suppose there is a screen with a text box where we can enter value & save record. But while running the test again it gives Duplicate value error to avoid this error i want to increment value of text box each time i run the test. What will be the code?

Posted: Fri Mar 06, 2009 3:25 pm
by Support Team
Something like the following code.

Code: Select all

// increments the text value 10 times and write it into the textbox
for(int i = 0;i<10;i++)
{
     repo.FormGoogle_Minus_GoogleMinus.TextSuche.DoubleClick();
     Keyboard.Press("test"+i);
 }
Regards,
Christian,
Ranorex Support Team

Posted: Sat Mar 07, 2009 6:26 am
by automationtool.1
i tried the code but it is not working at all... :(
where should i write the code ? in recording.cs file or Program.cs file?
also tell me where should i palce the for loop in the code?

Posted: Mon Mar 09, 2009 11:23 am
by Support Team
I dont`t know anything about your testing code.
Could you post your code where you access to the text box.

Regards,
Christian,
Ranorex Support Team