static void Main(string[] args) { string command ="C:\\Krypton\\Krypton.exe \"Browser=chrome\" \"TestCaseId=Demo.0001\"\r\n exit"; string ip = "localhost"; CallBackFunctionSignature callback = new CallBackFunctionSignature(CallBackFunction); ServiceAgent agent = new ServiceAgent(); agent.ExecuteCommand(ip, command, callback); Console.WriteLine("Press any key to stop execution..."); Console.ReadLine(); }
static void Main(string[] args) { ServiceAgent service = new ServiceAgent("10.101.21.235"); //string str = service.ConfigureHostFile(@"C:\Windows\System32\drivers\etc\hosts"); string str = service.InitializeSeleniumDriver("Chrome", "maxInstance=1", "10.101.22.74"); //string str1 = service.StopNode(); //string str = service.RestoreHostFile(); //service.KillProcessByName("cmd"); //service.StartExecutableByName("command.bat", @"C:\Users\jha.madhukar\Desktop\TwitterErrorImage1.jpg"); //string str = service.GetMachineName(); //XmlDocument xmlDoc = new XmlDocument(); //xmlDoc.LoadXml(str); //Console.WriteLine(xmlDoc.InnerText); Console.WriteLine("Press any key to stop execution..."); Console.ReadLine(); }
private string GetMachineNameFromIPAddress(string ipAdress) { string machineName = string.Empty; try { ServiceAgent service = new ServiceAgent(ipAdress); machineName = service.GetMachineName(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(machineName); machineName = xmlDoc.InnerText; } catch (Exception ex) { KryptonException.Writeexception(ex); Console.WriteLine("Unable to find the machine...."); } return machineName; }
public void UploadFileWithAutoIt() { try { ServiceAgent service = new ServiceAgent(_remoteIp); //Node ip service.StartExecutableByName(_autoitExeName, _filePath); Console.WriteLine(string.Format("Uploading file {0} on {1} machine..!!", _filePath, _remoteIp)); } catch(Exception ex) { throw new Exception( string.Format("Coud not Upload File on {0} machine. Actual Error:{1}",_remoteIp,ex.Message)); } }