首页 > 代码库 > WebDriverTest
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。