Пример #1
0
        public void Execute(Arguments arguments)
        {
            try
            {
                SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
                    "chrome",
                    "https://www.microsoft.com/en-in/microsoft-365/microsoft-teams/group-chat-software",
                    arguments.Timeout.Value,
                    false,
                    Scripter.Log,
                    Scripter.Settings.UserDocsAddonFolder.FullName);
                OnScriptEnd = () =>
                {
                    SeleniumManager.DisposeAllOpenedDrivers();
                    SeleniumManager.RemoveWrapper(wrapper);
                };
                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/teams-grid/div/div[1]/div/button";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.Click(arguments, arguments.Timeout.Value);

                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/div/div[2]/div/div[1]/div[2]/div[2]/div/div/input";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.TypeText(arguments.code.Value, arguments, arguments.Timeout.Value);

                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/div/div[2]/div/div[1]/div[2]/div[2]/div/div/div[2]/div/button";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.PressKey("Join team", arguments, arguments.Timeout.Value);
            }
            catch (Exception ex)
            {
                throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
            }
        }
        public void Execute(Arguments arguments)
        {
            try
            {
                SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
                    "chrome",
                    "https://teams.microsoft.com/_?culture=en-in&country=IN&lm=deeplink&lmsrc=homePageWeb&cmpid=WebSignIn#/calendarv2",
                    false,
                    Scripter.Log,
                    Scripter.Settings.UserDocsAddonFolder.FullName);
                int wrapperId = wrapper.Id;
                OnScriptEnd = () =>
                {
                    SeleniumManager.DisposeAllOpenedDrivers();
                    SeleniumManager.RemoveWrapper(wrapperId);
                    SeleniumManager.CleanUp();
                };
                arguments.Search.Value = "/html/body/div[1]/div[2]/div[1]/app-bar/nav/ul/li[5]/button";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.Click(arguments, arguments.Timeout.Value);

                SeleniumManager.CurrentWrapper.Refresh();
            }
            catch (Exception ex)
            {
                throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
            }
        }
Пример #3
0
        public void Execute(Arguments arguments)
        {
            try
            {
                SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
                    "chrome",
                    "https://teams.microsoft.com/_?culture=en-in&country=IN&lm=deeplink&lmsrc=homePageWeb&cmpid=WebSignIn#/conversations/General?threadId=19:[email protected]&messageId=1594783221657&replyChainId=1594627895659&ctx=channel",
                    arguments.Timeout.Value,
                    false,
                    Scripter.Log,
                    Scripter.Settings.UserDocsAddonFolder.FullName);
                int wrapperId = wrapper.Id;
                OnScriptEnd = () =>
                {
                    SeleniumManager.DisposeAllOpenedDrivers();
                    SeleniumManager.RemoveWrapper(wrapperId);
                    SeleniumManager.CleanUp();
                };
                arguments.Search.Value = "/html/body/div[1]/div[2]/div[1]/app-bar/nav/ul/li[1]/button";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.Click(arguments, arguments.Timeout.Value);

                SeleniumManager.CurrentWrapper.Refresh();
            }
            catch (Exception ex)
            {
                throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
            }
        }
 public void Execute(Arguments arguments)
 {
     try
     {
         SeleniumManager.QuitCurrentWrapper();
     }
     catch (Exception ex)
     {
         throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
     }
 }
        public void Execute(Arguments arguments)
        {
            try
            {
                SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
                    "chrome",
                    "https://www.microsoft.com/en-in/microsoft-365/microsoft-teams/group-chat-software",
                    arguments.Timeout.Value,
                    false,
                    Scripter.Log,
                    Scripter.Settings.UserDocsAddonFolder.FullName);
                int wrapperId = wrapper.Id;
                OnScriptEnd = () =>
                {
                    SeleniumManager.DisposeAllOpenedDrivers();
                    SeleniumManager.RemoveWrapper(wrapperId);
                    SeleniumManager.CleanUp();
                };
                arguments.Search.Value = "/html/body/div[1]/div[1]/app-header-bar/div/power-bar/div/div/button/ng-include/svg";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.Click(arguments, arguments.Timeout.Value);

                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/div/messages-header/div[2]/div/message-pane/div[1]/div[2]/chat-people-picker/div/div/div[1]/recipient-line/div/div/div[1]/div/people-picker/div/input";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.TypeText(arguments.name.Value, arguments, arguments.Timeout.Value);

                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/div/messages-header/div[2]/div/message-pane/div[2]/div[3]/new-message/div/div[2]/form/div[4]/div[1]/div[2]/div/div/div[2]/div/div/div";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.TypeText(arguments.message.Value, arguments, arguments.Timeout.Value);

                arguments.Search.Value = "/html/body/div[1]/div[2]/div[2]/div[1]/div/messages-header/div[2]/div/message-pane/div[2]/div[3]/new-message/div/div[3]/div[2]/button/ng-include/svg";
                arguments.By.Value     = "xpath";
                SeleniumManager.CurrentWrapper.Click(arguments, arguments.Timeout.Value);

                SeleniumManager.CurrentWrapper.Refresh();
            }
            catch (Exception ex)
            {
                throw new ApplicationException($"Error occured while opening new selenium instance. Message: {ex.Message}", ex);
            }
        }
 public void Execute(Arguments arguments)
 {
     try
     {
         SeleniumWrapper wrapper = SeleniumManager.CreateWrapper(
             arguments.Type.Value,
             "https://www.microsoft.com/en-in/microsoft-365/microsoft-teams/group-chat-software",
             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);
     }
 }