Exemplo n.º 1
0
 public void DianPingChaXunCase001()
 {
     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(MIDSleepTime);
         //订单页面跳转
         Log.Info("订单页面跳转");
         driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_PageLeft1_HotelOrder")).Click();
         Thread.Sleep(MinSleepTime);
         Log.Info("选择国内酒店");
         SeleniumFun.SelectByText(driver.FindElement(By.Id("ddl_orderRange")), "国内酒店");
         Log.Info("返回订单查询结果");
         driver.FindElement(By.Id("btn_search")).Click();
         Thread.Sleep(MinSleepTime);
         Log.Info("点击具体订单");
         driver.FindElement(By.XPath("//ul/li/div[3]/div[5]/div[2]/table/tbody/tr[1]/td[2]")).Click();
         Bcom.SwitchPage(driver);
         SeleniumFun.CheckSecurity(driver);
         Thread.Sleep(MIDSleepTime);
         //验证跳转页面正确
         CtripAssert.Contains(driver, driver.FindElement(By.ClassName("mem_location")).Text, "酒店订单", "验证跳转页面");
     }
     catch (Exception e)
     {
         new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString());
     }
 }
Exemplo n.º 2
0
        public void DianPingChaXunCase010()
        {
            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(MIDSleepTime);

                //订单页面跳转
                Log.Info("订单页面跳转");
                driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_PageLeft1_TicketOrder")).Click();
                Thread.Sleep(MIDSleepTime);
                Log.Info("等待订单查询结果");
                Log.Info("点击具体订单");
                driver.FindElement(By.XPath("//ul/li/div[3]/div[3]/div[2]/div/table/tbody/tr/td[2]")).Click();
                Bcom.SwitchPage(driver);
                SeleniumFun.CheckSecurity(driver);
                Thread.Sleep(MaxSleepTime);
                //验证跳转页面
                CtripAssert.Contains(driver, driver.FindElement(By.ClassName("od_state")).Text, "礼品卡订单详情", "验证跳转页面");
            }
            catch (Exception e)
            {
                new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString());
            }
        }
Exemplo n.º 3
0
        public void LianJieYanZhengCase006()
        {
            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("应用中心旅游分享链接验证");
                driver.FindElement(By.XPath("//ul/li/div[2]/dl[4]/dt/span")).Click();
                Thread.Sleep(MinSleepTime);
                driver.FindElement(By.Id("ctl00_MainContentPlaceHolder_PageLeft1_TripShare")).Click();
                Bcom.SwitchPage(driver);
                Thread.Sleep(MIDSleepTime);
                //验证跳转链接正确
                CtripAssert.Contains(driver, driver.Url.ToString(), "http://travel.testp.sh.ctriptravel.com/uid-aM00018803-kongjian", "验证链接跳转");
            }
            catch (Exception e)
            {
                new CtripException(driver, e.ToString(), this.GetType().ToString(), MethodBase.GetCurrentMethod().ToString());
            }
        }