Example #1
0
        /// <summary>
        /// Method to start the application with the specified type of browser, platform and URL
        /// </summary>
        public static void Start(BrowserType browserType, PlatformType platformType, string serverUrl, string driverPath, string applicationURL)
        {
            string browser = browserType.ToString().ToLower();
            DesiredCapabilities compat;

            switch (browserType)
            {
            case BrowserType.InternetExplorer:
                compat = DesiredCapabilities.InternetExplorer();
                break;

            case BrowserType.Chrome:
                compat = DesiredCapabilities.Chrome();
                break;

            case BrowserType.Safari:
                compat = DesiredCapabilities.Safari();
                break;

            case BrowserType.Firefox:
            default:
                compat = DesiredCapabilities.Firefox();
                break;
            }

            compat.IsJavaScriptEnabled = true;
            compat.Platform            = new Platform(platformType);
            webDriver = new ScreenShotRemoteWebDriver(compat);
            webDriver.Manage().Window.Maximize();
            webDriver.Url = applicationURL;
        }
Example #2
0
        public static void Start(BrowserType btype, PlatformType ptype, string driverPath, string url)
        {
            selenim = new DefaultSelenium("localhost", 4444, btype.ToString(), url);

            Init(btype, url, ptype, driverPath);

            selenim.Start();

            selenim.WindowMaximize();

            webDriver.Manage().Window.Maximize();

            if (btype != BrowserType.Chrome && btype != BrowserType.Safari)
            {
                webDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(60000));
            }

            webDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(60000));

            selenim.WaitForPageToLoad("120000");

            webDriver.Url = url;
            //selenim.Open(url);
        }