Forum Discussion
10 Replies
Sort By
- YMinaevStaffHi,
You need to use code like this:...
var drv = // Create a new DDT driver
var wnd = // Obtain the window which contains text boxes
while(!drv["EOF"]())
{
wnd.textBox1.Keys(drv["Value"]("textBox1Value"));
//...
wnd.textBoxN.Keys(drv["Value"]("textBoxNValue"));
drv["Next"]();
}
...
BTW, see the Using DDT Drivers help topic. - BroNew ContributorThank you for the reply but I'm stuck on the window obtaining. Should it be something like this: form1 = testApp["Form1"]; ? If I put something like this I don't have access to the textboxes in the form. The code I have written according to what you suggested looks like this:
var testCompleteApp;
var form1;
var drv = DDT["CSVDriver"]("C:\\Test.csv");
TestedApps["TestCompleteApp"]["Run"](1, true);
testCompleteApp = Aliases["TestCompleteApp"];
form1 = testCompleteApp["Form1"];
while(!drv["EOF"])
{
form1.textBox1.Keys(drv["Value"]("textBox1Value"));
drv["Next"]
}
form1["Close"](); - YMinaevStaffHi,
By 'form', I mean the window in which text boxes are located. You can find its name by inspecting it in the Object Browser. Also, text box names and DDT column names I used in my script are just to demonstrate the idea. In your application and your CSV file, these values will be different. - BroNew ContributorTo see the window in the object browser I have to have application running right?
- BroNew ContributorOk I got it but when I can't find the property Keys for the textBox object. When I type it in I get an error t\saying that this object does not suppert the property or method.
- YMinaevStaffHi,
Keys is a standard method, all objects in the object tree have it. Is the object, whose Keys method you're trying to call, found? - Hey Jared,
Could I get this code sample for VB Script? - AlexKarasChampion Level 3Hi Derek,
Something like this (untested plain translation):
Dim drv
Dim wnd
Set drv = ' Create a new DDT driver
Set wnd = ' Obtain the window which contains text boxes
While(Not drv.EOF())
wnd.textBox1.Keys(drv.Value("textBox1Value"))
'...
wnd.textBoxN.Keys(drv.Value("textBoxNValue"))
drv.Next()
Wend - scristian_1Occasional ContributorHello,
Can you help me with an example for JScript?
Best regards,
Cristian - scristian_1Occasional ContributorI found it, thanks!
Related Content
Recent Discussions
- 4 hours agoashly