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); } }
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}"); } }
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); } }