当前位置: 首页>>代码示例>>C#>>正文


C# ISelenium.WaitForFrameToLoad方法代码示例

本文整理汇总了C#中ISelenium.WaitForFrameToLoad方法的典型用法代码示例。如果您正苦于以下问题:C# ISelenium.WaitForFrameToLoad方法的具体用法?C# ISelenium.WaitForFrameToLoad怎么用?C# ISelenium.WaitForFrameToLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISelenium的用法示例。


在下文中一共展示了ISelenium.WaitForFrameToLoad方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateMarketIndex

        /// <summary> Update the Market Index Value of a selection dynamically, also we can suspend the market
        /// Author : Yogesh M
        /// Date Created: Feb 05 2011 
        /// Date Modfied: March 06 2011
        /// Modification Comments: Added the status of market in the method
        /// Note: Market Index value is <= number of selections the market has
        /// eg: updatedMarketIndexValue = UpdateMarketIndex(browser, selectionId, 2, Suspended);
        ///                               UpdateMarketIndex(browser, selectionId, 0, Active); //label=Suspended or label=Active
        /// <param name="browser">Selenium Browser instance</param>
        /// </summary>
        /// <param name="browser"> </param>
        /// <param name="selectionId">Selection Id of the selection</param>
        /// <param name="updatedMarketIndexValue">User entered value of updated market index</param>
        /// <param name="status"> </param>
        /// <returns>Updated Market Index value</returns>
        public string UpdateMarketIndex(ISelenium browser, string selectionId, int updatedMarketIndexValue, string status)
        {
            try
            {

                string updatedMarektIndex = "";
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, selectionId);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                _frameworkCommon.WaitUntilAllElementsLoad(browser);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                if (updatedMarketIndexValue != 0)
                {
                    //update the marketIndex value in the market page
                    updatedMarektIndex = Convert.ToString(updatedMarketIndexValue, CultureInfo.InvariantCulture);
                    browser.Type(AdminSuite.CommonControls.EventDetailsPage.BirIndexTextBox, updatedMarektIndex);
                    Console.WriteLine("Market index is updated to : " + updatedMarektIndex + "");
                    //return updatedMarektIndex;
                }
                if (String.IsNullOrWhiteSpace(status) == false)
                {
                    browser.Select("name=MktStatus", "label=" + status + "");
                }
                // Updating the event details page
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                return updatedMarektIndex;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
                return null;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:57,代码来源:Common.cs

示例2: UpdateEventStartDateTimeBySelectionID

        public void UpdateEventStartDateTimeBySelectionID(ISelenium browser, string selectionID, string startDateTime)
        {
            try
            {
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, selectionID);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, "label=Even outcome");// AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                _frameworkCommon.WaitUntilAllElementsLoad(browser);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                string startTimeXpath = "//input[@name='EvStartTime']";

                browser.Type(startTimeXpath, startDateTime);

                //if (browser.IsElementPresent(startTimeXpath))
                //{
                //    //startTime = browser.GetText(startTimeXpath);
                //    startTime = browser.GetValue(startTimeXpath);
                //}

                //Updating the Event
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn))
                {
                    browser.Click(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn);
                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                    Assert.IsTrue(_frameworkCommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "Event Updation is not Successfull");
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
                //return null;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:45,代码来源:Common.cs

示例3: UpdateMarketByMarketID

        /// <summary>
        /// Update market by Market id in Open bet
        /// </summary>
        /// <param name="browser">Browser instance</param>
        /// <param name="marketId">Market id</param>
        /// <param name="marketStatus">Market status</param>
        /// <param name="marketDisplayed">Display</param>
        public void UpdateMarketByMarketID(ISelenium browser, string marketId, string marketStatus, string marketDisplayed)
        {
            try
            {
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, marketId);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, "label=Event market");// AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                _frameworkCommon.WaitUntilAllElementsLoad(browser);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                //browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
                //browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                if (string.Empty != marketStatus)
                {
                    if (marketStatus == "Suspend")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.marketStatusListBox, "label=Suspended");
                    }
                    else if (marketStatus == "Active")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.marketStatusListBox, "label=Active");
                    }
                    else
                    {
                        throw new AutomationException("Market status is invalid.");
                    }
                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                }

                if (string.Empty != marketDisplayed)
                {
                    if (marketDisplayed == "Yes")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.mktDisplayListBox, "label=Yes");
                    }
                    else if (marketDisplayed == "No")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.mktDisplayListBox, "label=No");
                    }
                    else
                    {
                        throw new AutomationException("Market displayed is invalid.");
                    }
                }

                //update Market
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton))
                {
                    browser.Click(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton);
                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                    Assert.IsTrue(_frameworkCommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "Market Updation is not Successfull");
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
                //return null;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:73,代码来源:Common.cs

示例4: UpdateEventsByEventID

        public void UpdateEventsByEventID(ISelenium browser, string eventID, string eventStatus, string eventDisplayed)
        {
            try
            {
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, eventID);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyLevelEvent);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                if (string.Empty != eventStatus)
                {
                    if (eventStatus == "Suspend")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventStatusListBox, "label=Suspended");
                    }
                    else if (eventStatus == "Active")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventStatusListBox, "label=Active");
                    }
                    else
                    {
                        throw new AutomationException("Event status is invalid.");
                    }
                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                }

                if (string.Empty != eventDisplayed)
                {
                    if (eventDisplayed == "Yes")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventDisplayStatusLstBx, "label=Yes");
                    }
                    else if (eventDisplayed == "No")
                    {
                        browser.Select(AdminSuite.CommonControls.EventDetailsPage.eventDisplayStatusLstBx, "label=No");
                    }
                    else
                    {
                        throw new AutomationException("Event displayed is invalid.");
                    }
                }

                //Updating the Event
                if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn))
                {
                    browser.Click(AdminSuite.CommonControls.EventDetailsPage.updateEventBtn);
                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                    Assert.IsTrue(_frameworkCommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "Event Updation is not Successfull");
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
                //return null;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:63,代码来源:Common.cs

示例5: UpdateEachWayByEventID

        public void UpdateEachWayByEventID(ISelenium browser, string eventId, string status)
        {
            try
            {
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, eventId);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyLevelEvent);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                _frameworkCommon.WaitUntilAllElementsLoad(browser);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                //browser.Click("label=|Race Winner|");

                if (browser.IsElementPresent(string.Format("link=|{0}|", "Race Winner")))
                {
                    browser.Click(string.Format("link=|{0}|", "Race Winner"));
                    _frameworkCommon.WaitUntilAllElementsLoad(browser);
                    browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                    browser.Select("name=MktEWAvail", "label=" + status);

                    if (status == "Yes")
                    {
                        browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayPlacesTxtBx, "1");
                        browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayTopTxtBx, "1");
                        browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayBottomTxtBx, "1");
                    }

                    browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);

                    //update Market
                    if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton))
                    {
                        browser.Click(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton);
                        browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                        Assert.IsTrue(_frameworkCommon.WaitUntilElementPresent(browser, AdminSuite.CommonControls.EventDetailsPage.eventDescriptionTextBox, "120"), "Market Updation is not Successfull");
                    }

                }
                else
                {
                    Console.WriteLine("Market is not available");
                }
                Thread.Sleep(3000);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:55,代码来源:Common.cs

示例6: UpdateEachWay

        /// <summary>
        /// Update each way in Open bet.
        /// </summary>
        /// <param name="browser">Browser instance</param>
        /// <param name="selectionId">Selection id</param>
        /// <param name="eachWayPlaces">Each way place</param>
        /// <param name="eachWayTopValue">Top value</param>
        /// <param name="eachWayBottomValue">bottom value</param>
        /// <returns></returns>
        public string UpdateEachWay(ISelenium browser, string selectionId, string eachWayPlaces, string eachWayTopValue, string eachWayBottomValue)
        {
            try
            {
                string updatedMarektIndex = "";
                //Clicking on Event Link in LHN
                LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
                //Selecting TopFrame
                SelectMainFrame(browser);
                browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
                browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, selectionId);
                browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
                browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
                _frameworkCommon.WaitUntilAllElementsLoad(browser);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

                if (string.Empty != eachWayPlaces && "0" != eachWayPlaces.Trim())
                {
                    browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayPlacesTxtBx, eachWayPlaces);
                    Console.WriteLine("Each way Places is  updated to : " + eachWayPlaces + "");
                }

                if (string.Empty != eachWayTopValue && "0" != eachWayTopValue.Trim())
                {
                    browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayTopTxtBx, eachWayTopValue);
                    Console.WriteLine("Each way top is  updated to : " + eachWayTopValue + "");
                }

                if (string.Empty != eachWayBottomValue && "0" != eachWayBottomValue.Trim())
                {
                    browser.Type(AdminSuite.CommonControls.EventDetailsPage.EachWayBottomTxtBx, eachWayBottomValue);
                    Console.WriteLine("Each way Bottom is  updated to : " + eachWayBottomValue + "");
                }

                // Updating the event details page
                browser.Click(AdminSuite.CommonControls.EventDetailsPage.ModifyMarketButton);
                browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
                return updatedMarektIndex;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message);
                return null;
            }
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:57,代码来源:Common.cs

示例7: GogoEventPageByEventId

        /// <summary>
        /// Goto Event details page by Event id
        /// </summary>
        /// <param name="browser">Browser instance</param>
        /// <param name="testData">TestDAta</param>
        /// <param name="eventId">Event id</param>
        public void GogoEventPageByEventId(ISelenium browser, TestData testData, string eventId)
        {
            //Clicking on Event Link in LHN
            LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
            //Selecting TopFrame
            SelectMainFrame(browser);
            System.Threading.Thread.Sleep(10000);

            browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
            browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, eventId);
            browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, "label=Event");// AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
            browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
            //_frameworkCommon.WaitUntilAllElementsLoad(browser);
            browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
            Thread.Sleep(3000);
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:22,代码来源:Common.cs

示例8: GetEventStartDateTimeBySelectionID

        public string GetEventStartDateTimeBySelectionID(ISelenium browser, string selectionID)
        {
            //Clicking on Event Link in LHN
            LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
            //Selecting TopFrame
            SelectMainFrame(browser);
            browser.WaitForFrameToLoad(AdminSuite.CommonControls.AdminHomePage.EventNameLink, FrameGlobals.PageLoadTimeOut);
            browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, selectionID);
            browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, "label=Even outcome");// AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
            browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
            _frameworkCommon.WaitUntilAllElementsLoad(browser);

            browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
            browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page

            browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
            browser.Click(AdminSuite.CommonControls.EventDetailsPage.BackButton);//click on back button present in the selection page
            browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);

            string startTime = GetEventStartDateTime(browser);
            return startTime;

            //2013-05-07 22:22:03
        }
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:24,代码来源:Common.cs


注:本文中的ISelenium.WaitForFrameToLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。