Beispiel #1
0
        public static void CloseNewTab()
        {
            ReadOnlyCollection <String> windowHandles = WebDriverManager.GetWebDriver().WindowHandles;
            String lastTab = windowHandles[windowHandles.Count - 1];

            WebDriverManager.GetWebDriver().SwitchTo().Window(lastTab);
        }
Beispiel #2
0
 public static IWebDriver Init()
 {
     driverManager = WebDriverFactory.GetDriverManager(browser);
     driver        = driverManager.GetWebDriver();
     driver.Manage().Window.Maximize();
     return(driver);
 }
Beispiel #3
0
        public ArticlePage BackToArticlePage()
        {
            ReadOnlyCollection <String> windowHandles = WebDriverManager.GetWebDriver().WindowHandles;
            String firstTab = (String)windowHandles[0];

            WebDriverManager.GetWebDriver().SwitchTo().Window(firstTab);
            return(new ArticlePage());
        }
Beispiel #4
0
        public static void OpenNewTab(string url)
        {
            var originalTabInstance = WebDriverManager.GetWebDriver().CurrentWindowHandle;

            WebDriverManager.GetWebDriver().ExecuteJavaScript("window.open();");
            ReadOnlyCollection <String> windowHandles = WebDriverManager.GetWebDriver().WindowHandles;
            String lastTab = windowHandles[windowHandles.Count - 1];

            WebDriverManager.GetWebDriver().SwitchTo().Window(lastTab);
            WebDriverManager.GetWebDriver().Navigate().GoToUrl(url);
        }
Beispiel #5
0
        public ArticlePage AddFishbackLink(String FishbackLink)
        {
            Element.WaitUntilDisplayed(AddFishbackButtonLocator, 10000);
            Element.Click(AddFishbackButtonLocator);
            Commons.Sleep(3000);
            var linkFishback = Element.FindElement(LinkFishbackLocator);

            WebDriverManager.GetWebDriver().SwitchTo().Frame(linkFishback);
            Element.WaitUntilDisplayed(SearchLinkButtonLocator, 10000);
            Element.Click(SelectPublicationLocator);
            Element.Click(OilDailyLinkLocator);
            Element.InputText(TitleForLinkLocator, FishbackLink);
            Element.Click(SearchLinkButtonLocator);
            Commons.Sleep(3000);
            Element.Click(OgpLocator);
            Element.Click(AddSelectedBuutonLocator);
            WebDriverManager.GetWebDriver().SwitchTo().DefaultContent();
            return(new ArticlePage());
        }
Beispiel #6
0
 public static void Open(String url)
 {
     WebDriverManager.GetWebDriver().Navigate().GoToUrl(url);
 }