当前位置: 首页>>代码示例>>C#>>正文


C# FirefoxDriver.Manage方法代码示例

本文整理汇总了C#中OpenQA.Selenium.Firefox.FirefoxDriver.Manage方法的典型用法代码示例。如果您正苦于以下问题:C# FirefoxDriver.Manage方法的具体用法?C# FirefoxDriver.Manage怎么用?C# FirefoxDriver.Manage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenQA.Selenium.Firefox.FirefoxDriver的用法示例。


在下文中一共展示了FirefoxDriver.Manage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SingUp_TestUser_FindNameInHelloString

        public void SingUp_TestUser_FindNameInHelloString()
        {
            firefox = new FirefoxDriver();
            firefox.Navigate().GoToUrl("http://localhost:57336/");
            firefox.FindElement(By.Id("register")).Click();

            //register page
            firefox.FindElement(By.Id("inputFirstName")).SendKeys("testFirstName");
            firefox.FindElement(By.Id("inputLastName")).SendKeys("testLastName");
            firefox.FindElement(By.Id("inputEmail")).SendKeys("[email protected]");
            firefox.FindElement(By.Id("inputPassword")).SendKeys("123");
            firefox.FindElement(By.Id("submit")).Click();
            firefox.FindElement(By.Id("login")).Click();

            //log in page
            firefox.FindElement(By.Id("inputEmail")).SendKeys("[email protected]");
            firefox.FindElement(By.Id("inputPassword")).SendKeys("123");
            firefox.FindElement(By.Id("login")).Click();

            firefox.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
            string helloString = firefox.FindElement(By.Id("helloString")).Text;
            string result = "Hello, testFirstName testLastName";

            //delete test user
            firefox.Navigate().GoToUrl("http://localhost:57336/User/UsersProfile");
            firefox.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
            firefox.FindElement(By.Id("deleteProfile")).Click();

            Assert.IsTrue(result == helloString);
        }
开发者ID:aminternship2015,项目名称:team04,代码行数:30,代码来源:UserControllerTests.cs

示例2: CreateWebDriver

 public IWebDriver CreateWebDriver()
 {
     var driver = new FirefoxDriver();
     driver.Manage().Window.Maximize();
     driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3));
     return driver;
 }
开发者ID:xcyroo,项目名称:InnovationDay.AcceptanceTesting,代码行数:7,代码来源:LocalFirefoxEnvironment.cs

示例3: Main

        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();

            driver.Navigate().GoToUrl("http://www.seleniummaster.com/");

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

            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
            IWebElement menu = driver.FindElement(By.Id("menubar"));
            Actions builder = new Actions(driver);
            builder.MoveToElement(menu).Build().Perform();

            IList<IWebElement> menuItemsList = menu.FindElements(By.Id("menu"));
            char[] delim = { '\r', '\n' };
            String[] menuList = menuItemsList[0].Text.Split(delim);

            //Query to orderby all the list items
            IEnumerable<string> orderedMenuList = menuList.OrderBy(lv_menu => lv_menu).ToList();

            //Display the ordered list
            foreach (string menuItem in orderedMenuList)
            {
                if (menuItem.Length > 0)
                    Console.WriteLine(menuItem);
            }
            Console.ReadKey();
        }
开发者ID:SahanaVishakanta,项目名称:WebDriverProjects,代码行数:28,代码来源:Program.cs

示例4: Main

        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();

            driver.Navigate().GoToUrl("http://www.integrationqa.com/");

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

            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
            IWebElement menu = driver.FindElement(By.Id("hs_menu_wrapper_module_13970568219884"));
            Actions builder = new Actions(driver);
            builder.MoveToElement(menu).Build().Perform();

            IList<IWebElement> menuItemsList = menu.FindElements(By.ClassName("hs-menu-item"));

            String[] menuItems = new String[menuItemsList.Count];
            int i = 0;
            foreach (IWebElement menuItem in menuItemsList)
            {
                menuItems[i++] = menuItem.Text;
            }

            //Arrange all the list items in alphabetical order
            IEnumerable<String> orderedMenuList = menuItems.OrderBy(lv_menu => lv_menu).ToList();

            //Display the ordered list
            foreach (var menuItem in orderedMenuList)
            {
                if (menuItem.Length > 0)
                    Console.WriteLine(menuItem);
            }
            Console.ReadKey();
        }
开发者ID:SahanaVishakanta,项目名称:WebDriverProjects,代码行数:33,代码来源:Program.cs

示例5: CreateWebDriver

 public IWebDriver CreateWebDriver()
 {
     var driver = new FirefoxDriver();
     driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(2000));
     driver.Manage().Window.Maximize();
     return driver;
 }
开发者ID:Bumblebee,项目名称:Bumblebee.Examples,代码行数:7,代码来源:LocalFirefoxEnvironment.cs

示例6: CreateWithDefaultProperties

        /// <summary>
        ///   Yahoo overrides standard DOM event methods (i.e. onclick("", ...)) causing webdriver to trigger unexpected memory protection exceptions 
        /// </summary>
        public static IWebDriver CreateWithDefaultProperties()
        {
            var caps = new OpenQA.Selenium.Remote.DesiredCapabilities();
            caps.SetCapability(OpenQA.Selenium.Remote.CapabilityType.HasNativeEvents, false);
            
            var driver = new FirefoxDriver(caps);
            driver.Manage().Window.Maximize();
            driver.Manage().Cookies.DeleteAllCookies();

            return driver;
        }
开发者ID:c0d3m0nky,项目名称:mty,代码行数:14,代码来源:WebDriverExtensions.cs

示例7: FirefoxBrowser

        public static IWebDriver FirefoxBrowser()
        {
            IWebDriver driver;

            driver = new FirefoxDriver();
            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
            driver.Navigate().GoToUrl(BaseURL);

            return driver;
        }
开发者ID:anapsousa,项目名称:Springer,代码行数:11,代码来源:Constants.cs

示例8: CreateDriver

 public override IWebDriver CreateDriver()
 {
     Console.WriteLine("Create Factory FF WD");
     FirefoxProfile profile = new FirefoxProfile();
     profile.EnableNativeEvents = true;
     profile.DeleteAfterUse = true;
     IWebDriver factoryDriver = new FirefoxDriver(profile);
     factoryDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20));
     factoryDriver.Manage().Window.Maximize();
     return factoryDriver;
 }
开发者ID:AliakseiF,项目名称:BYTA_AF_Framework,代码行数:11,代码来源:FactoryMethodFF.cs

示例9: SetUp

        public void SetUp()
        {
            IWebDriver driver = new FirefoxDriver();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));

            browser = new Browser(driver);
        }
开发者ID:adbacker,项目名称:selenium2_quickstarts,代码行数:7,代码来源:LoginTests.cs

示例10: Main

 static void Main(string[] args)
 {
     try
         {   // Instantiating variables
             string[] theURLs = new string[3];
             string[] theCriteria = new string[3];
             int wi, milsec=2500;
             // Instantiating classes
             IWebDriver wbDriver = new FirefoxDriver();
             TheWebURLs webI=new TheWebURLs();
             LoggingStuff logMe = new LoggingStuff();
             wbDriver.Manage().Window.Maximize();
             // Setting values for variables
             theURLs=webI.getTheURLs();
             theCriteria=webI.getSearchCiteria();
             string logPath = logMe.createLogName().ToString();
             /**********************************************/
             // Run Test
             logMe.writeFile("Selenium Test Log", false, logPath);
             for(wi = 0; wi < 3; wi++)
             {   // Opens the various web pages
                 Console.WriteLine(theURLs[wi] + ", " + theCriteria[wi]);
                 logMe.writeFile(theURLs[wi] + ", " + theCriteria[wi], true, logPath);
                 wbDriver.Navigate().GoToUrl(theURLs[wi]);
                 Thread.Sleep(milsec*2);
             }
             wbDriver.Quit();
         }
     catch (IOException e3)
     {
         Console.WriteLine("Failed during Main",e3.Message);
     }
 }
开发者ID:vonbailey,项目名称:CSharp_Selenium,代码行数:33,代码来源:UnitTest_Selenium1.cs

示例11: Main

        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();

            int idInicio = 30000;
            int idFinal = 22000;
            int contador = 1;
            String url = "";

            driver.Navigate().GoToUrl(url + idInicio);
            driver.Manage().Window.Maximize();
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"e:\AllStudents.csv", true))
            {

                while (idInicio > idFinal)
                {
                    driver.Navigate().GoToUrl(url + idInicio);
                    IWebElement nome = driver.FindElement(By.Id("txtNome"));
                    IWebElement email = driver.FindElement(By.Id("txtmail_maior"));
                    if (email.GetAttribute("value").ToString() != "")
                    {
                        Console.WriteLine(contador + " - " + idInicio.ToString() + " - " + nome.GetAttribute("value").ToString() + " - " + email.GetAttribute("value").ToString());
                        file.WriteLine(contador + ";" + idInicio.ToString() + ";" + email.GetAttribute("value").ToString() +";"+ nome.GetAttribute("value").ToString());

                        contador++;
                    }
                    idInicio--;
                }
            }
        }
开发者ID:wesleyxavierTestes,项目名称:BuscaDados,代码行数:30,代码来源:Program.cs

示例12: Main

        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();
            const int idInicio = 0;
            const int idFim = 1000;

            int id = idInicio;
            String url = "http://fcv.matheusacademico.com.br/Aluno/frmAlunoAlteracao.asp?id=";

            driver.Navigate().GoToUrl(url + id);
            driver.Manage().Window.Maximize();

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"c:\AllStudents1.txt", true))
            {
                while (id < idFim)
                {
                    driver.Navigate().GoToUrl(url + id);
                    IWebElement nome = driver.FindElement(By.Id("txtNome"));
                    IWebElement email = driver.FindElement(By.Id("txtmail_maior"));

                    if (nome.GetAttribute("value").ToString() != "")
                        file.WriteLine(id.ToString() + " - " + nome.GetAttribute("value").ToString() + " - " + email.GetAttribute("value").ToString());
                    id++;
                }
            }
        }
开发者ID:wesleyxavierTestes,项目名称:PesquisadorAlunos,代码行数:26,代码来源:Program.cs

示例13: PostToBlog

 public void PostToBlog()
 {
     IWebDriver browser = new FirefoxDriver();
     browser.Navigate().GoToUrl("http://tumblr.com/login");
     IWebElement email = browser.FindElement(By.Id("signup_determine_email"));
     email.SendKeys("[email protected]");
     IWebElement verifyButton = browser.FindElement(By.Id("signup_forms_submit"));
     verifyButton.Click();
     browser.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
     IWebElement password = browser.FindElement(By.Id("signup_password"));
     password.SendKeys("******");
     IWebElement loginButton = browser.FindElement(By.Id("signup_forms_submit"));
     loginButton.Click();
     IWebElement textIcon = browser.FindElement(By.ClassName("icon_post_text"));
     textIcon.Click();
     IWebElement postTitle = browser.FindElement(By.ClassName("editor-plaintext"));
     postTitle.SendKeys("c# selenium");
     IWebElement postBody = browser.FindElement(By.ClassName("editor-richtext"));
     postBody.SendKeys("this is a c# with selenium test");
     IWebElement createPost = browser.FindElement(By.ClassName("create_post_button"));
     createPost.Click();
     //TearDown
     IWebElement postSettings = browser.FindElement(By.ClassName("post_control_menu"));
     postSettings.Click();
     IWebElement postDelete = browser.FindElement(By.ClassName("delete"));
     postDelete.Click();
     IWebElement okButton = browser.FindElement(By.ClassName("btn_1"));
     okButton.Click();
     IWebElement accountButton = browser.FindElement(By.ClassName("icon_user_settings"));
     browser.Close();
 }
开发者ID:tking16,项目名称:Selenium,代码行数:31,代码来源:UnitTest1.cs

示例14: LogonTest

        public void LogonTest()
        {
            IWebDriver driver = new FirefoxDriver();
            //IWebDriver driver = new ChromeDriver();
            //IWebDriver driver = new InternetExplorerDriver();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));

            //ChromeDriver driver = new ChromeDriver();
            string homepageURL = "https://localhost:44300/";

            IndexPage indexPageObject = new IndexPage(driver);

            //open home page
            indexPageObject.OpenPage(homepageURL);

            //verify the user is not logged in
            Assert.IsTrue(indexPageObject.CheckAuthentication(false));

            //navigate to login page
            LoginPage loginPage = indexPageObject.NavigateToLoginPage();

            //enter id and password and login
            indexPageObject = loginPage.Login("[email protected]", "F5ft2mz0_");

            //verify the user is logged in
            Assert.IsTrue(indexPageObject.CheckAuthentication(true));

            //driver.Close();
        }
开发者ID:dwwhalen,项目名称:SimplyLists,代码行数:29,代码来源:HomePageTests.cs

示例15: FirefoxStartup

 public void FirefoxStartup()
 {
     FirefoxDriver dr = new FirefoxDriver();
     dr.Manage().Window.Maximize();
     dr.Navigate().GoToUrl(url);
     dr.Quit();
 }
开发者ID:sh9901,项目名称:AutomationTest,代码行数:7,代码来源:BrowserStartTest.cs


注:本文中的OpenQA.Selenium.Firefox.FirefoxDriver.Manage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。