// Test pressing a key 10 times var i; for(i = 0; i < 10; ++i) { device.key("a"); }
The "device"-object exists inside the test engine and is written as a .NET class:
public class DeviceProxy { public void key(string key) { sendCommand("key " + key); Console.WriteLine("Pressing '{0}'", key); } }
ScriptControl sc = new ScriptControl(); DeviceProxy deviceProxy = new DeviceProxy(); sc.Language = "JScript"; sc.AddObject("device", deviceProxy, true); sc.AddCode(File.ReadAllText(scriptPath));
Posted in Automated Testing |Comments [0]
Remember Me
BestBrains is a software consultancy company that help others improve the way they are developing software. See our main site at www.bestbrains.dk.