Ejemplo n.º 1
0
        public void Demo_Emulator()
        {
            DriverProperty property = new DriverProperty();

            property.DriverType = DriverType.Chrome;

            WebDriver.InitDriverManager(property);
            WebDriver.AddNewDriver(property);
            WebDriver.GoToUrl("http://google.com.vn");

            WebDriver.QuitAllDriver();
        }
Ejemplo n.º 2
0
        public static void Open(DriverType browser, string url, bool headless, string fileDownloadLocation, string argument = null)
        {
            DriverProperty prop = new DriverProperty
            {
                DriverType       = browser,
                Headless         = headless,
                DownloadLocation = fileDownloadLocation,
                Arguments        = argument
            };

            WebDriver.AddNewDriver(prop);
            WebDriver.GoToUrl(url);
            MaximizeWindow();
        }
Ejemplo n.º 3
0
        public static void Open(DriverType browser, string url)
        {
            DriverProperty prop = WebDriver.DefaultProperty;

            if (prop.DriverType != browser)
            {
                prop = new DriverProperty
                {
                    DriverType = browser
                };
            }
            WebDriver.AddNewDriver(prop);
            WebDriver.GoToUrl(url);
            MaximizeWindow();
        }
Ejemplo n.º 4
0
        public void Demo_Applitool()
        {
            EyesRunner runner = new ClassicRunner();
            Eyes       eye    = new Eyes(runner);

            var suiteConfig = new Applitools.Selenium.Configuration();

            suiteConfig
            // Test suite configurations
            .SetApiKey("KgPPOMrJBHbsgzaZ1oJ5A18sNMPiZEXpiRSGqOv6qmk110")
            .SetBatch(new BatchInfo("Demo Regression 001"));

            eye.SetConfiguration(suiteConfig);

            DriverProperty property = new DriverProperty();

            property.DriverType = DriverType.Chrome;
            WebDriver.InitDriverManager(property);
            WebDriver.AddNewDriver(property);
            eye.Open(WebDriver.Driver, "DEMO", "Demo Test 001");
            WebDriver.GoToUrl("http://google.com.vn");

            WebDriver.Sleep(5);

            eye.CheckWindow("Google home page 1");
            eye.Check(Target.Window().Layout(By.XPath("")).Region(By.XPath("")));

            WebDriver.Sleep(5);

            eye.CheckWindow("Google home page 2");

            eye.CloseAsync();

            WebDriver.QuitAllDriver();

            runner.GetAllTestResults(true);
        }