Last active
August 29, 2015 14:08
-
-
Save thu2004/cbd141a190846fbef2f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by SharpDevelop. | |
* User: thu | |
* Date: 2014-10-31 | |
* Time: 09:22 | |
* | |
* To change this template use Tools | Options | Coding | Edit Standard Headers. | |
*/ | |
using System; | |
using TestStack.White; | |
using TestStack.White.UIItems; | |
using TestStack.White.UIItems.WindowItems; | |
namespace white_acs | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
string acs_program = "c:\\tmp\\AXISCameraStationSetup.exe"; | |
Console.WriteLine("Hello World!"); | |
Application.Launch(acs_program); | |
System.Threading.Thread.Sleep(5000); | |
Window win = Desktop.Instance.Windows().Find(x => x.Name == "Select Setup Language"); | |
win.Get<Button>("OK").Click(); | |
System.Threading.Thread.Sleep(10000); | |
win = Desktop.Instance.Windows().Find(x => x.Name == "Setup - AXIS Camera Station"); | |
win.Get<Button>("Next >").Click(); | |
win.Get<RadioButton>("I accept the agreement").Click(); | |
win.Get<Button>("Next >").Click(); | |
// Select Destination | |
win.Get<Button>("Next >").Click(); | |
// Select Components | |
win.Get<Button>("Next >").Click(); | |
// Firewall | |
win.Get<Button>("Next >").Click(); | |
// List a items. The checkbox item is missing. | |
win.Items.ForEach(obj => Console.WriteLine("--> " + obj.ToString())); | |
// Select addional Tasks | |
win.Get<CheckBox>("Create an AXIS Camera Station Client desktop icon").Select(); | |
win.Get<Button>("Next >").Click(); | |
if (win.Exists<Button>("Next >")) | |
win.Get<Button>("Next >").Click(); | |
win.Get<Button>("Install").Click(); | |
// win.WaitTill(()=>win.Exists<Button>("Finish"), TimeSpan.FromMinutes(5)); | |
System.Threading.Thread.Sleep(60000); | |
win.Get<Button>("Finish").Click(); | |
Console.Write("Press any key to continue . . . "); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment