Exemplo n.º 1
0
        /// <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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        /// <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;
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        /// <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;
            }
        }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
0
        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
        }