public void LianJieYanZhengCase001() { try { Log.Info("开始执行用例"); //打开首页 baseURL = UserHT["url"].ToString(); driver.Navigate().GoToUrl(baseURL); //登录 LoginOn loginOn = new LoginOn(driver, LogWrite); loginOn.CNLoginOn(UserHT["测试用户登录名"].ToString(), UserHT["测试用户登陆密码"].ToString()); Thread.Sleep(MinSleepTime); //验证应用中心菜单收起 Log.Info("验证应用中心菜单默认收起"); Boolean flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_FlightTool")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "应用中心菜单默认收起"); //验证应用中心菜单展开 Log.Info("验证应用中心菜单展开"); driver.FindElement(By.XPath("//ul/li/div[2]/dl[4]/dt/span")).Click(); Thread.Sleep(MinSleepTime); flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_FlightTool")); CtripAssert.AreEqual(driver, flag.ToString(), "True", "应用中心菜单已展开"); } catch (Exception e) { new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString()); } }
public void DingDanGuanLiCase001() { try { Log.Info("开始执行用例"); //打开首页 baseURL = UserHT["url"].ToString(); driver.Navigate().GoToUrl(baseURL); //登录 LoginOn loginOn = new LoginOn(driver, LogWrite); loginOn.CNLoginOn(UserHT["测试用户登录名"].ToString(), UserHT["测试用户登陆密码"].ToString()); Thread.Sleep(5000); //验证订单管理菜单展开,其他菜单收起 Log.Info("验证订单管理菜单展开"); Boolean flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_ALLOrder")); CtripAssert.AreEqual(driver, flag.ToString(), "True", "我的订单菜单已展开"); flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_MyAccount")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "个人中心菜单未展开"); flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_Passenger")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "常用信息管理菜单未展开"); flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_MyAccount")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "应用中心菜单未展开"); //点击其他菜单,收起订单管理菜单 driver.FindElement(By.XPath("//ul/li/div[2]/dl[2]/dt/span")).Click(); //验证订单管理菜单已收起 flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_ALLOrder")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "我的订单菜单已收起"); } catch (Exception e) { new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString()); } }
public void YongHuXinXi001() { try { Log.Info("开始执行用例"); //打开首页 baseURL = UserHT["url"].ToString(); driver.Navigate().GoToUrl(baseURL); //登录 LoginOn loginOn = new LoginOn(driver); loginOn.CNLoginOn(UserHT["测试用户登录名"].ToString(), UserHT["测试用户登陆密码"].ToString()); Thread.Sleep(MinSleepTime); //验证个人中心菜单收起 Log.Info("验证个人中心菜单默认收起"); Boolean flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_MyAccount")); CtripAssert.AreEqual(driver, flag.ToString(), "False", "个人中心菜单默认收起"); //验证个人中心菜单展开 Log.Info("验证个人中心菜单展开"); driver.FindElement(By.Id("menu_person_icon_id")).Click(); Thread.Sleep(MinSleepTime); flag = SeleniumFun.IsVisible(driver, By.Id("ctl00_MainContentPlaceHolder_PageLeft1_MyAccount")); CtripAssert.AreEqual(driver, flag.ToString(), "True", "个人中心菜单已展开"); } catch (Exception e) { new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString()); } }