WebDriverTest
Posted York
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WebDriverTest相关的知识,希望对你有一定的参考价值。
using OpenQA.Selenium.Firefox; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using OpenQA.Selenium; namespace WebDriverTest { class Program { static void Main(string[] args) { var driver = new FirefoxDriver(); driver.Url = "http://192.168.0.252/"; driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(3); driver.Manage().Timeouts().Asynchronousjavascript = TimeSpan.FromSeconds(2); driver.FindElementById("_easyui_textbox_input1").SendKeys("ERIC"); driver.FindElementById("_easyui_textbox_input3").SendKeys("ERIC"); Thread.Sleep(TimeSpan.FromSeconds(3)); driver.ExecuteScript("f_Login();"); Thread.Sleep(TimeSpan.FromSeconds(3)); driver.FindElementByCssSelector("[data_funid=‘1A101‘]").Click(); IWebElement frameEl = driver.FindElementByTagName("iframe"); driver.SwitchTo().Frame(frameEl); driver.FindElementById("aAdd").Click(); driver.FindElementById("_easyui_textbox_input2").SendKeys("Test"); //var driver = new FirefoxDriver(); //driver.Url = "https://www.baidu.com/"; //driver.FindElementById("kw").SendKeys("WebDriver"); //driver.FindElementById("su").Click(); } } }
以上是关于WebDriverTest的主要内容,如果未能解决你的问题,请参考以下文章