public void SetupTest() { HttpCommandProcessor processor = new HttpCommandProcessor(); DefaultBrowserLauncher launcher = new InternetExplorerBrowserLauncher(); selenium = new DefaultSelenium(processor, launcher, DefaultSelenium.SELENESE_RUNNER_URL.Replace("html", "hta")); selenium.Start(); }
public void MyTestInitialize() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://login.live.com/"); selenium.Start(); selenium.SetSpeed("800"); verificationErrors = new StringBuilder(); }
public void SetupTest() { url = "http://localhost:52994/"; selenium = new DefaultSelenium("localhost", 4444, "*chrome", url); selenium.Start(); verificationErrors = new StringBuilder(); }
/** * SetupTest used to create a Selenium object and start it * */ private void SetupTest() { string filename = "java"; string parameters = @" -jar selenium-server.jar"; System.Diagnostics.Process[] allProcess = System.Diagnostics.Process.GetProcessesByName("java"); try { if (allProcess.Length == 0) { System.Diagnostics.Process.Start(filename, parameters); System.Threading.Thread.Sleep(3000); selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.set.or.th"); selenium.Start(); selenium.SetTimeout("100000"); selenium.UseXpathLibrary("javascript-xpath"); } } catch (System.Exception e) { logger.LogErrorAndRaiseException("Selenium console not started." + e.ToString()); System.Windows.Forms.Application.Exit(); } }
public void SetupTest(string nav) { selenium = new DefaultSelenium("localhost", 4444, "*" + nav, "http://localhost:9080"); selenium.Start(); verificationErrors = new StringBuilder(); }
public void SetupTest() { //selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://maps.google.com/"); selenium = new DefaultSelenium("localhost", 5555, "*iexplore", "https://maps.google.com/"); selenium.Start(); verificationErrors = new StringBuilder(); }
public void SetupTest() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", UpgradeSeleniumTester.browserURL); selenium.Start(); verificationErrors = new StringBuilder(); }
public void SetupClass() { base.StartServer(); selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["baseUrl"]); selenium.Start(); verificationErrors = new StringBuilder(); selenium.DeleteAllVisibleCookies(); selenium.Open("/dna/mbfood/"); // To Do // too general, could crash test if a topic happened to have the wrong name Assert.IsFalse(selenium.IsTextPresent("error")); Assert.IsFalse(selenium.IsTextPresent("There has been a problem")); selenium.Click("link=Sign in"); selenium.Click("bbcid_username"); selenium.Type("bbcid_username", "mpgsuper"); selenium.Type("bbcid_password", "ratbags"); selenium.Click("signin"); selenium.WaitForPageToLoad("30000"); // going this way so as to be certain to get the right site options without thinking about it selenium.Click("link=Site Options"); selenium.WaitForPageToLoad("30000"); // check a) where we are b) BBC site requirements for page titles https://confluence.dev.bbc.co.uk/display/DNA/Meta+Data - note that this title breaks those guidelines Assert.AreEqual("BBC - Food - DNA Administration - Site Options - Food", selenium.GetTitle()); Assert.IsTrue(selenium.IsElementPresent("//input[@name='sov_49_General_CustomBarlesquePath']"); stateOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='radio' and @checked='']/@value"); valueOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='text']"); }
public virtual void SetupTest() { proc = new HttpCommandProcessor("localhost", 4444, "*chrome", _3DR_Testing.Properties.Settings.Default._3DRURL); selenium = new DefaultSelenium(proc); verificationErrors = new StringBuilder(); selenium.Start(); }
public void SetupTest() { HttpCommandProcessor processor = new HttpCommandProcessor(); DefaultBrowserLauncher launcher = new DefaultBrowserLauncher(); selenium = new DefaultSelenium(processor, launcher); selenium.Start(); }
public void SetUp() { selenium = new DefaultSelenium("localhost", 4444, "*iexplore", URL); selenium.Start(); selenium.Open(URL); silvernium = new Silvernium(selenium, OBJECTID, SCRIPTKEY); }
//Constructor public SeleniumMsTestLiveAccountLogin1() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://login.live.com/"); selenium.Start(); selenium.SetSpeed("800"); verificationErrors = new StringBuilder(); }
public void SetupTest() { base.StartServer(); selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["baseUrl"]); selenium.Start(); verificationErrors = new StringBuilder(); }
public void SetUp() { selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost"); selenium.Start(); selenium.Open("http://localhost"); silvernium = new Silvernium(selenium, "Test"); }
// UpdateResourceFile("pradeep","@E:\AdminScripts\ECommerce_CodeBase\PreRequisite_Suite\Resources\Customers.resx"); /// <summary> To Launch the browser & to login to Open Bet application /// </summary> /// Author: Yogesh /// Ex: AdminBase.init() /// <returns>None</returns> /// Created Date: 22-Dec-2011 /// Modified Date: /// Modification Comments: public void Init() { if (FrameGlobals.useGrid.ToUpper() == "YES") { FirefoxProfile ffProfile = new FirefoxProfile(); DesiredCapabilities desriredCapibilities = null; desriredCapibilities = new DesiredCapabilities(); desriredCapibilities = DesiredCapabilities.Firefox(); desriredCapibilities.SetCapability(CapabilityType.BrowserName, "firefox"); // ffProfile.SetPreference("general.useragent.override", FrameGlobals.userAgentValue); FfDriver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), desriredCapibilities, TimeSpan.FromSeconds(420.0)); MyBrowser = new WebDriverBackedSelenium(FfDriver, "http://www.google.com"); //_seleniumContainer.Add(Gallio.Framework.TestContext.CurrentContext.Test.Name, MyBrowser); } else { FfDriver = new FirefoxDriver(); MyBrowser = new WebDriverBackedSelenium(FfDriver, FrameGlobals.OBUrl); //MyBrowser = new WebDriverBackedSelenium(FfDriver, "https://stg-gib.ladbrokes.com/admin"); } MyBrowser.Start(); MyBrowser.Open(FrameGlobals.OBUrl); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.UsrNmeTxtBx, FrameGlobals.AdminName); MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.PwdTxtBx, FrameGlobals.AdminPass); // MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Click(AdminSuite.CommonControls.AdminHomePage.LoginBtn); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut.ToString()); // MyBrowser.WindowMaximize(); FfDriver.Manage().Window.Maximize(); }
public void SetupTest() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://*****:*****@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\RolandoV\My Documents\PWAS\PWAS_Site\PWAS_Site\App_Data\PWAS_DB.mdf;Integrated Security=True;User Instance=True"); orderRepo = new OrderRepository(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\RolandoV\My Documents\PWAS\PWAS_Site\PWAS_Site\App_Data\PWAS_DB.mdf;Integrated Security=True;User Instance=True"); orderHistoryRepo = new OrderHistoryRepository(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\RolandoV\My Documents\PWAS\PWAS_Site\PWAS_Site\App_Data\PWAS_DB.mdf;Integrated Security=True;User Instance=True"); if (orderRepo.Orders.Where(o => o.job_name == "Salsa Impulse").Count() > 0) { List <Order> orders = orderRepo.Orders.Where(o => o.job_name == "Salsa Impulse").ToList(); List <OrderHistory> ohistories = (from oh in orderHistoryRepo.OrderHistories where (from o in orders select o.orderID).Contains(oh.orderId) select oh).ToList(); Table <OrderHistory> ohTable = (Table <OrderHistory>)orderHistoryRepo.OrderHistories; ohTable.DeleteAllOnSubmit(ohistories); Table <Order> orderTable = (Table <Order>)orderRepo.Orders; orderTable.DeleteAllOnSubmit(orders); ohTable.Context.SubmitChanges(); orderTable.Context.SubmitChanges(); } if (userRepo.Users.Where(u => u.email == "*****@*****.**").Count() > 0) { User user = userRepo.Users.First(u => u.email.Trim() == "*****@*****.**"); userRepo.DeleteUser(user.userID); userRepo.SubmitChanges(); } verificationErrors = new StringBuilder(); }
virtual public void SetupTest() { proc = new HttpCommandProcessor("localhost", 4444, "*chrome", _3DR_Testing.Properties.Settings.Default._3DRURL); selenium = new DefaultSelenium(proc); verificationErrors = new StringBuilder(); selenium.Start(); }
public void Init() { //Deleting cookies in ie browser through command line. /*var procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"); var proc = new System.Diagnostics.Process { StartInfo = procStartInfo }; proc.Start(); WebDriverObj = new InternetExplorerDriver(); */ string URL = "https://stg-gib.ladbrokes.com/admin"; WebDriverObj = new FirefoxDriver(); MyBrowser = new WebDriverBackedSelenium(WebDriverObj, URL); MyBrowser.Start(); WebDriverObj.Manage().Window.Maximize(); MyBrowser.WindowMaximize(); MyBrowser.Open(URL); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Refresh(); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Type(TestDataCreation.ControlsRepository.UsrNmeTxtBx, "Automation1"); MyBrowser.Type(TestDataCreation.ControlsRepository.PwdTxtBx, "aditi123"); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Click(TestDataCreation.ControlsRepository.LoginBtn); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); }
public void Start(string siteUrl) { _siteUrl = siteUrl; _selenium = new DefaultSelenium(Configuration.SeleniumHost, Configuration.SeleniumPort, "*firefox", _siteUrl); _selenium.Start(); _selenium.SetTimeout(Timeout); }
public JavaSelenium(ISelenium pSelenium, string pObjectID) { _selenium = pSelenium; _objectID = pObjectID; _selenium.Start(); _SetJSPrefix(); }
public void StartSelenium() { string platform = System.Configuration.ConfigurationManager.AppSettings["Platform"]; selenium = new DefaultSelenium("localhost", 4444, platform, "http://www.google.com.hk/"); selenium.Start(); selenium.WindowMaximize(); }
public void Initialize() { RemoteWebDriver driver = new OpenQA.Selenium.Firefox.FirefoxDriver(); selenium = new WebDriverBackedSelenium(driver, "http://localhost/SiteStarter"); selenium.Start(); verificationErrors = new StringBuilder(); }
private void setupBrowser() { // NOTE: These base URLs only work for systems who happen to have the same integration and localhost suffix (For example, localhost/RlePersonnel and integration.redstapler.biz/RlePersonnel). // Systems like MITCalendar will not work until we come up with a better solution. // NOTE: This should not be hard-coded. var baseUrl = "https://integration.redstapler.biz/"; if (ConfigurationStatics.IsDevelopmentInstallation) { if (ConfigurationStatics.InstallationConfiguration.WebApplications.Any(wa => wa.SupportsSecureConnections)) { baseUrl = "https://localhost/"; } else { baseUrl = "http://localhost/"; } } selenium = new DefaultSelenium("localhost" /*location of Selenium server*/, 4444, @"*firefox3 C:\Program Files (x86)\Mozilla Firefox\firefox.exe", baseUrl); selenium.Start(); if (ConfigurationStatics.IsIntermediateInstallation) { executeSeleniumBlock( "Intermediate log on", delegate { // NOTE: We need to go to the specific URL here instead of relying on a redirect, or Selenium will time out or otherwise fail (it sucks at following redirects). selenium.Open("/" + ConfigurationStatics.InstallationConfiguration.SystemShortName + "/Ewf/IntermediateLogIn.aspx?ReturnUrl="); // NOTE: Does not work for MIT Calendar, etc. selenium.Type("ctl00_ctl00_main_contentPlace_ctl12_theTextBox", ConfigurationStatics.SystemGeneralProvider.IntermediateLogInPassword); // NOTE: Move g8Summit to machine configuration file. SubmitForm(selenium); selenium.WaitForPageToLoad("30000"); }); } if (UserManagementStatics.UserManagementEnabled /* && FormsAuthStatics.FormsAuthEnabled */) { executeSeleniumBlock( "Forms log on", delegate { // NOTE: System-name approach suffers from same problem as above. selenium.Open("/" + ConfigurationStatics.InstallationConfiguration.SystemShortName + "/Ewf/UserManagement/LogIn.aspx?ReturnUrl="); // NOTE: I don't think we need waits after opens. selenium.WaitForPageToLoad("30000"); Assert.IsTrue(selenium.GetTitle().EndsWith("Log In")); // NOTE: For RSIS, we need the ability to pass a different email address and a different password for testing. //selenium.Type( "ctl00_ctl00_main_contentPlace_emailAddress_theTextBox", ConfigurationStatics.SystemGeneralProvider.FormsLogInEmail ); //selenium.Type( "ctl00_ctl00_main_contentPlace_password_theTextBox", ConfigurationStatics.SystemGeneralProvider.FormsLogInPassword ); SubmitForm(selenium); selenium.WaitForPageToLoad("30000"); }); } }
public void Initialize() { RemoteWebDriver driver = new OpenQA.Selenium.IE.InternetExplorerDriver(); selenium = new WebDriverBackedSelenium(driver, "http://localhost/SiteStarter"); selenium.Start(); verificationErrors = new StringBuilder(); }
public void StartupServer(string _ip) { selenium = new DefaultSelenium("localhost", 4444, "*firefox", _ip);//firefox//googlechrome//iexplore selenium.Start(); selenium.SetSpeed("500"); selenium.Open("/config"); selenium.WindowMaximize(); System.Threading.Thread.Sleep(1000); }
public ISelenium GetCurrentSelenium() { if (selenium == null) { selenium = new WebDriverBackedSelenium(StartDriver(), "http://localhost:" + this.port.ToString() + "/selenium-server/tests"); selenium.Start(); } return(selenium); }
public ISelenium GetCurrentSelenium() { if (selenium == null) { selenium = new WebDriverBackedSelenium(StartDriver(), "http://localhost:" + this.port.ToString() + "/selenium-server/tests"); selenium.Start(); } return selenium; }
public void SetupTest() { selenium = new DefaultSelenium("localhost", 4444, "*firefox", url); selenium.SetSpeed("1000"); selenium.Start(); verificationErrors = new StringBuilder(); selenium.Open(""); selenium.WindowMaximize(); //selenium.KeyDown(ID, "13");//enter key }
public void SetupTest() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/"); selenium.Start(); verificationErrors = new StringBuilder(); selenium.Open("/"); selenium.Type("id=loginPassword", "lex"); selenium.Type("id=loginUsername", "lex"); selenium.Click("//div[@id='logindisplay']/form[2]/input[3]"); selenium.WaitForPageToLoad("30000"); }
public void Init() { firefox = new FirefoxDriver(); browser = new WebDriverBackedSelenium(firefox, "http://cms.uat-ecommerce.ladbrokes.com/hmc/hybris?wid=MC57x0"); browser.Start(); browser.Open("http://cms.uat-ecommerce.ladbrokes.com/hmc/hybris?wid=MC57x0"); browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut.ToString()); browser.Type("id=Main_user", "mallikarjunmp"); browser.Type("id=Main_password", "12345"); browser.Click("id=Main_label"); browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut.ToString()); }
public SilverlightApplicationFixture(string host, int port, string browserString, string url) { _selenium = new DefaultSelenium(host, port, browserString, url); _selenium.Start(); _selenium.Open(url); _selenium.SetSpeed("100"); _silvernium = new ThoughtWorks.Selenium.Silvernium.Silvernium(_selenium, ObjectId, Scriptkey); while (!_silvernium.IsLoaded()) { Thread.Sleep(100); } }
public void Login() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/"); selenium.Start(); selenium.Open("/"); selenium.Type("id=loginUsername", "lex"); selenium.Type("id=loginPassword", "lex"); selenium.Click("//div[@id='logindisplay']/form[2]/input[3]"); selenium.WaitForPageToLoad("30000"); selenium.Click("//a[contains(@href, 'UserActivity/Index')]"); selenium.WaitForPageToLoad("30000"); }
public WebTestContext() { lock (locker) { ExpressUnitConfigurationSection config = (ExpressUnitConfigurationSection)System.Configuration.ConfigurationManager.GetSection("ExpressUnitConfiguration"); Selenium = new DefaultSelenium(config.WebTestSettings.SeleniumHost, config.WebTestSettings.SeleniumPort, config.WebTestSettings.Browser, config.WebTestSettings.StartUrl); Selenium.Start(); Selenium.Open(config.WebTestSettings.StartUrl); } }
public void Login() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]); selenium.Start(); selenium.Open("/"); selenium.Type("id=loginUsername", "prof"); selenium.Type("id=loginPassword", "prof"); selenium.Click("//div[@id='logindisplay']/form[2]/input[3]"); selenium.WaitForPageToLoad("40000"); selenium.Click("link=Courses"); selenium.WaitForPageToLoad("40000"); }
public void Login() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]); selenium.Start(); selenium.Open("/"); selenium.Type("id=loginUsername", "lex"); selenium.Type("id=loginPassword", "lex"); selenium.Click("//div[@id='logindisplay']/form[2]/input[3]"); selenium.WaitForPageToLoad("30000"); selenium.Click("//a[contains(@href, 'UserActivity/Index')]"); selenium.WaitForPageToLoad("30000"); }
public void SetupTest() { try { selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:9080/"); selenium.Start(); verificationErrors = new StringBuilder(); } catch (Exception exc) { throw new Exception(exc.Message); } }
public void Login() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/"); selenium.Start(); selenium.Open("/"); selenium.Type("id=loginUsername", "prof"); selenium.Type("id=loginPassword", "prof"); selenium.Click("//div[@id='logindisplay']/form[2]/input[3]"); selenium.WaitForPageToLoad("30000"); selenium.Click("link=Courses"); selenium.WaitForPageToLoad("30000"); }
public void TestMethod3() { string URL = "http://www.abb.com"; selenium = new DefaultSelenium("localhost", 4444, "*firefox", URL); selenium.Start(); selenium.Open("/"); Assert.AreEqual("The ABB Group - Automation and Power Technologies", selenium.GetTitle()); selenium.Type("searchInput", "Robot"); selenium.Click("search"); selenium.WaitForPageToLoad("10000"); Assert.AreEqual("The ABB Group", selenium.GetTitle()); Assert.AreEqual("Robot", selenium.GetValue("searchInput")); }
public void Init() { FfDriver = new FirefoxDriver(); MyBrowser = new WebDriverBackedSelenium(FfDriver, "https://stg-gib.ladbrokes.com/admin"); MyBrowser.Start(); MyBrowser.Open("https://stg-gib.ladbrokes.com/admin"); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.UsrNmeTxtBx, "sanjeeva_p"); MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.PwdTxtBx, "123456"); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); MyBrowser.Click(AdminSuite.CommonControls.AdminHomePage.LoginBtn); MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut); }
public void SetupTest() { SetUp(); var host = ConfigurationManager.AppSettings["Host"]; var port = ConfigurationManager.AppSettings["Port"]; var browser = ConfigurationManager.AppSettings["Browser"]; var url = ConfigurationManager.AppSettings["BasedUrl2"]; _selenium = new DefaultSelenium(host, int.Parse(port), browser, url); _selenium.Start(); _selenium.SetSpeed("5000"); _verificationErrors = new StringBuilder(); }
public static void StartServers() { if (_running) return; _server = new HttpServer.HttpServer(); _server.Add(new FileReaderModule()); _server.Start(IPAddress.Any, 9100); _selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:9100"); _selenium.Start(); _selenium.SetContext("NET Selenium DSL Tests"); _running = true; }
//Purpose: Selecting Browser To Run Test public static void BrowserSetup() { if (Browser.ToUpper().Equals("IE")) { String processorArchitecture = Microsoft.Win32.Registry.GetValue( "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment" , "PROCESSOR_ARCHITECTURE", null).ToString(); string ieDriverPath = (Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\..\\..\\..\\..\\ExternalAssemblies\\" + ((processorArchitecture == "x86") ? "x86" : "x64")).Replace("file:\\", ""); var options = new InternetExplorerOptions { IntroduceInstabilityByIgnoringProtectedModeSettings = true }; WebDriver = new InternetExplorerDriver(ieDriverPath, options, TimeSpan.FromMinutes(10)); WebDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromMinutes(5)); BackedSelenium = new WebDriverBackedSelenium(WebDriver, ConfigurationManager.AppSettings["browserUrl"]); BackedSelenium.Start(); } if (Browser.ToUpper().Equals("FF")) { FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.EnableNativeEvents = false; WebDriver = new FirefoxDriver(); WebDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromMinutes(5)); BackedSelenium = new WebDriverBackedSelenium(WebDriver, ConfigurationManager.AppSettings["browserUrl"]); BackedSelenium.Start(); } if (Browser.ToUpper().Equals("Safari")) { WebDriver = new SafariDriver(); WebDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromMinutes(5)); BackedSelenium = new WebDriverBackedSelenium(WebDriver, ConfigurationManager.AppSettings["browserUrl"]); BackedSelenium.Start(); } if (Browser.ToUpper().Equals("GC")) { string chromeDriverPath = (Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\..\\..\\..\\..\\ExternalAssemblies").Replace("file:\\", ""); WebDriver = new ChromeDriver(chromeDriverPath); Thread.Sleep(5000); BackedSelenium = new WebDriverBackedSelenium(WebDriver, ConfigurationManager.AppSettings["browserUrl"]); BackedSelenium.Start(); } }
private static void StartSelenium() { if (seleniumCache == null) { // var dataDirectory = ConfigurationManager.AppSettings["DataDirectory"]; // var absoluteDataDirectory = Path.GetFullPath(dataDirectory); var appUrl = ConfigurationManager.AppSettings["AppUrl"]; //AppDomain.CurrentDomain.SetData("DataDirectory", absoluteDataDirectory); seleniumCache = new DefaultSelenium("localhost", 4444, "*chrome", appUrl); //seleniumCache = new DefaultSelenium("localhost", 4444, "*firefoxproxy", appUrl); seleniumCache.Start(); Console.WriteLine("-> Selenium started"); } ScenarioContext.Current.SetSelenium(seleniumCache); }
public ActionResult ParseTourFromUrl(ParseUrlModel model) { selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost"); selenium.Start(); selenium.SetTimeout("120000"); selenium.Open(model.Url); selenium.WaitForPageToLoad("60000"); var html = selenium.GetHtmlSource(); selenium.Stop(); // string html = HtmlDownloader.GetHtml(model.Url); string s = new ForecastParser(QueryFactory, log, UnitOfWorkFactory).ParseHtml(html, model.Url); return(View(new ParseUrlModel { Result = s })); }
public void Init() { try{ selenium = new DefaultSelenium("http://www.clinicaldatalabs.com/", 80, "{\"username\": \"gurucdl\"," + "\"access-key\": \"3a14310f-84aa-4c7a-8172-aee0ba45c8c6\"," + "\"os\": \"Windows 2003\"," + "\"browser\": \"firefox\"," + "\"browser-version\": \"7\"," + "\"name\": \"Testing Selenium 1 with C# on Sauce\"}", "http://www.clinicaldatalabs.com/"); selenium.Start(); } catch(Exception e){ //System.Console.Out(e.Message); } }
/// <summary> /// Launches the browser. /// </summary> /// <param name="browser">The browser.</param> /// <param name="uri">The URI.</param> public void Start(BrowserModel browser, Uri uri) { if (uri == null) { throw new ArgumentNullException("uri"); } StartServer(); string browserStr = Enum <BrowserModel> .Value(browser); _selenium = new DefaultSelenium(_serverHost, _serverPort, browserStr, uri.AbsoluteUri); _selenium.Start(); _selenium.WindowFocus(); //_selenium.WindowMaximize(); _selenium.Open("/"); _selenium.WaitForPageToLoad("50000"); }
public void Run() { try { string[] files = Directory.GetFiles(log_path + "a"); for (int i = 0; i < files.Length; i++) { File.Delete(files[i]); } files = Directory.GetFiles(log_path + "b"); for (int i = 0; i < files.Length; i++) { File.Delete(files[i]); } Console.WriteLine("Start selenium instance: host={0}", selenium1_url); selenium1 = new DefaultSelenium(selenium_server, selenium_server_port, browser, selenium1_url); selenium1.Start(); Console.WriteLine("Start selenium instance: host={0}", selenium2_url); selenium2 = new DefaultSelenium(selenium_server, selenium_server_port, browser, selenium2_url); selenium2.Start(); compare_showcase(); } catch (Exception ee) { Console.WriteLine("Exception: {0}", ee.Message); } finally { try { selenium1.Stop(); selenium2.Stop(); } catch (Exception ee) { Console.WriteLine("Exception: {0}", ee.Message); } } Console.WriteLine("Press any key to continue......"); //Console.ReadKey(); }
public void StartSelenium() { verificationErrors = new StringBuilder(); string platform = System.Configuration.ConfigurationManager.AppSettings["Platform"]; this.URL = System.Configuration.ConfigurationManager.AppSettings["TestURL"]; //get un/pw from db //this.UN = ""; //this.PW = ""; selenium = new DefaultSelenium("localhost", 4444, platform, this.URL); //selenium = new DefaultSelenium("localhost", 4444, "*firefox3 C:\\Program Files\\Mozilla Firefox\\firefox.exe", "http://dev.lofinc.net"); selenium.Start(); Thread.Sleep(5000); selenium.WindowMaximize(); selenium.SetTimeout("0"); selenium.Open("/admin/"); this.selenium.WaitForPageToLoad("5000"); }
private void StartRC() { string filename = "java"; string parameters = @" -jar selenium-server.jar"; System.Diagnostics.Process[] allProcess = System.Diagnostics.Process.GetProcessesByName("java"); try { System.Diagnostics.Process.Start(filename, parameters); System.Threading.Thread.Sleep(5000); selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://196.11.63.237:8080/"); selenium.Start(); //selenium.UseXpathLibrary("javascript-xpath"); } catch (System.Exception e) { MessageBox.Show("Selenium console not started." + e.ToString()); System.Windows.Forms.Application.Exit(); } }