Re: Scripting wIntegrate object model with vbscript/TestComplete -
10-03-2006
, 06:36 PM
I have succeded in doing this, though I am now using Javascript (in the
TestComplete testing tool from Automated QA).
The main problem is that the predefined constants are not available. I
figured some out by guessing and trial and error.
Here is code to create a Wintegrate session:
var wIntApp = new ActiveXObject("wIntegrate.document");
gwIntSession = wIntApp.Session;
wIntApp.WindowState = "0"; // make visible
gwIntSession.Setting("Port") = "Windows Sockets";
gwIntSession.Setting("Host") = HostAddress; // ip address
gwIntSession.Setting("Emulation") = "wyse50"
gwIntSession.Setting("BackPages") = "20"
gwIntSession.Setting("PortOpen") = "1"; // open the port
// test getting screen text
var text = gwIntSession.Window.Text(0,0,79,23, 0, 0, 0,
0);
Log.Message ("win text len: " + text.length + ", txt:" + text);
// test getting Caret Position
var pos0 = gwIntSession.Window.CaretPosition ("0");
Log.Message ("caret posn 0:" + pos0);
var pos1 = gwIntSession.Window.CaretPosition ("1");
Log.Message ("caret posn 1:" + pos1);
var pos2 = gwIntSession.Window.CaretPosition ("2");
Log.Message ("caret posn 2:" + pos2);
var pos3 = gwIntSession.Window.CaretPosition ("3");
Log.Message ("caret posn 3:" + pos3);
// send to Wintegrate (emulate keypresses)
gwIntSession.Send ("username", "1"); // 1-send with CR at end
BuiltIn.Delay (1000);
gwIntSession.Send ("pw", "1");
BuiltIn.Delay (1000);
followup to my old post of Sat, May 20 2006 . |