public void init() { //启动浏览器 WebDriver seleiun = new WebDriver(); drive = seleiun.getDriver(); //读取config参数,读取ip this.xmlConfig = Core.GetRMXML("config.xml", true); //加载xml string weburl = xmlConfig.gNode("Platform/IP").InnerText; //读取xml参数 drive.Navigate().GoToUrl(weburl); //s输入网址 ple = new LocatYyaml(drive, "Xpath.txt"); //传递webdr对象,读取文件参数 Console.WriteLine("初始化:访问地址URL:{0}", weburl); // drive.Manage().Window.Maximize(); //窗口最大化 }
public void init() { //启动浏览器 WebDriver seleiun = new WebDriver(); drive = seleiun.getDriver(); //读取config参数,读取ip this.xmlConfig = Core.GetRMXML("config.xml", true); //加载xml string weburl = xmlConfig.gNode("Platform/IP").InnerText; //读取xml参数 drive.Navigate().GoToUrl(weburl); //s输入网址 ple = new LocatYyaml(drive, "Xpath.txt"); //传递webdr对象,读取文件参数 Console.WriteLine("初始化:访问地址URL:{0}", weburl); // drive.Manage().Window.Maximize(); //窗口最大化 Selp.sl(5); ple.getElement("user").Clear(); ple.getElement("pwd").Clear(); //清楚用户密码 ple.getElement("pwd").SendKeys(pwd); //管理员密码amdin ple.getElement("login").Click(); Selp.sl(3); }