| ZennoLab.Emulation Assembly > ZennoLab.Emulation Namespace : Emulator Class |

public class Emulator
// set active window string result = Emulator.ActiveWindow("Simple window"); // check result if (result == "ok" && !Emulator.ErrorDetected) { // send key "z" result = Emulator.SendKey("Simple window", 100, 200, System.Windows.Forms.Keys.Z, KeyboardEvent.Press); // check result if (result == "ok" && !Emulator.ErrorDetected) { // send text result = Emulator.SendText("Simple window", 100, 200, "Simple text", false); // check result if (result == "ok" && !Emulator.ErrorDetected) { // mouse move Emulator.MouseMove("Simple window",350, 370); // mouse click on button as result it will show save file dialog result = Emulator.MouseClick("Simple window", MouseButton.Left, MouseButtonEvent.Click, 350, 370); // check result if (result == "ok" && !Emulator.ErrorDetected) { // click on button with text "Save" return Emulator.ButtonClick("Save as", "Save"); } else return "Fail"; } else return "Fail"; } else return "Fail"; } else return "Fail"; // close window result = Emulator.CloseWindow("Simple window"); // check result if (result != "ok" || Emulator.ErrorDetected) return "Fail"; return "All done";
// set active window $result = Emulator:ActiveWindow("Simple window"); // check result if ($result == "ok" && !Emulator::ErrorDetected) { // send key "z" $result = Emulator::SendKey("Simple window", 100, 200, System\Windows\Forms\Keys::Z, KeyboardEvent::Press); // check result if ($result == "ok" && !Emulator::ErrorDetected) { // send text $result = Emulator::SendText("Simple window", 100, 200, "Simple text", false); // check result if (result == "ok" && !Emulator.ErrorDetected) { // mouse move Emulator::MouseMove("Simple window", 350, 3700); // mouse click on button as result it will show save file dialog $result = Emulator::MouseClick("Simple window", MouseButton::Left, MouseButtonEvent::Click, 350, 370); // check result if ($result == "ok" && !Emulator::ErrorDetected) { // click on button with text "Save" return Emulator::ButtonClick("Save as", "Save"); } else return "Fail"; } else return "Fail"; } else return "Fail"; } else return "Fail"; // close window $result = Emulator::CloseWindow("Simple window"); // check result if ($result != "ok" || Emulator::ErrorDetected) return "Fail"; return "All done";
System.Object
ZennoLab.Emulation.Emulator
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.