Beispiel #1
0
        public void TestMethod1()
        {
            IWebElement draggable;
            IWebElement drop;
            var         driver  = new WebDriverFactory().Create(BrowserType.Chrome);
            var         actions = new Actions(driver);

            driver.Navigate().GoToUrl("http://*****:*****@id='credit2']/a"));
            drop      = driver.FindElement(By.XPath("//*[@id='bank']/li"));
            //actions.DragAndDrop(draggable, drop).Perform();
            actions.ClickAndHold(draggable).MoveToElement(drop).Release().Perform();

            driver.Quit();
        }
        public void AsSelectSample()
        {
            var driver = new WebDriverFactory(new DriverParams {
                Driver = "chrome", Binaries = @"C:\automation-env\web-drivers"
            }).Get();

            driver.Manage().Window.Maximize();
            driver.Navigate().GoToUrl("https://gravitymvctestapplication.azurewebsites.net/Course");
            driver.FindElement(By.XPath("//select[@id='SelectedDepartment']")).AsSelect().SelectByValue("4");
            Thread.Sleep(2000);
            driver.Dispose();
        }
        public void WebDriverFactorySample()
        {
            var driver = new WebDriverFactory(new DriverParams {
                Driver = "chrome", Binaries = @"C:\automation-env\web-drivers"
            }).Get();

            driver.Manage().Window.Maximize();
            driver.Navigate().GoToUrl("https://gravitymvctestapplication.azurewebsites.net");
            driver.FindElement(By.XPath("//a[.='Students']")).Click();
            Thread.Sleep(2000);
            driver.Dispose();
        }
        public void GoToUrlSampleFw()
        {
            var driver = new WebDriverFactory(new DriverParams
            {
                Driver = "chrome", Binaries = @"C:\tools"
            })
                         .Get()
                         .GoToUrl("https://gravitymvctestapplication.azurewebsites.net/");

            driver.FindElement(By.XPath("//a[contains(.,'Students')]")).Click();
            Thread.Sleep(2000);
            driver.Dispose();
        }
Beispiel #5
0
        public void WebDriverFactorySample()
        {
            var driver = new WebDriverFactory(new DriverParams {
                Driver = "chrome", Binaries = @"D:\automation-env\web-drivers"
            }).Get();

            driver.Manage().Window.Maximize();

            driver.Navigate().GoToUrl("https://www.way2automation.com/");
            var element       = driver.FindElement(By.XPath("//a"));
            var selectElement = new SelectElement(element);

            selectElement.SelectByValue("4");

            Thread.Sleep(1000);
            driver.Dispose();
        }