Esempio n. 1
0
 public void Execute(Arguments arguments)
 {
     try
     {
         IEManager.Detach(IEManager.CurrentIE);
     }
     catch (Exception ex)
     {
         throw new ApplicationException($"Problem occured while detaching Internet Explorer instance. Message: {ex.Message}", ex);
     }
 }
Esempio n. 2
0
 public void Execute(Arguments arguments)
 {
     try
     {
         var wrapper = IEManager.AttachToExistingIE(arguments.Phrase.Value, arguments.By.Value);
         OnScriptEnd = () =>
         {
             IEManager.Detach(wrapper);
         };
         Scripter.Variables.SetVariableValue(arguments.Result.Value, new IntegerStructure(wrapper.Id));
         wrapper.ActivateTab(arguments.By.Value, arguments.Phrase.Value);
     }
     catch (Exception ex)
     {
         throw new ArgumentException($"Failed while trying to attach to existing Internet Explorer instance. Please, make sure Internet Explorer instance is running and that the specified searching phrase is correct. Additional message: {ex.Message}");
     }
 }
Esempio n. 3
0
 private IEWrapper CreateIeInstance(bool closeError)
 {
     try
     {
         IEWrapper wrapper = IEManager.AddIE();
         wrapper.Ie = new WatiN.Core.IE();
         if (closeError)
         {
             OnScriptEnd = () =>
             {
                 IEManager.Detach(wrapper);
             };
         }
         return(wrapper);
     }
     catch (Exception ex)
     {
         throw new ApplicationException($"Error occured while trying to create new Internet Explorer instance. Additional message: {ex.Message}", ex);
     }
 }