示例#1
0
 public void Execute(Arguments arguments)
 {
     try
     {
         SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
             "chrome",
             "https://web.whatsapp.com/",
             arguments.Timeout.Value,
             false,
             Scripter.Log,
             Scripter.Settings.UserDocsAddonFolder.FullName);
         int wrapperId = wrapper.Id;
         OnScriptEnd = () =>
         {
             SeleniumManager.DisposeAllOpenedDrivers();
             SeleniumManager.RemoveWrapper(wrapperId);
             SeleniumManager.CleanUp();
         };
     }
     catch (Exception ex)
     {
         throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
     }
 }
示例#2
0
 public static void RemoveWrapper(SeleniumWrapper wrapper)
 {
     wrappers.Remove(wrapper);
     wrapper = null;
 }
示例#3
0
 public static void Quit(SeleniumWrapper wrapper)
 {
     wrapper.Quit();
     RemoveWrapper(wrapper);
 }