Ejemplo n.º 1
0
        public void enterEmptyMarketValueStoryDetails(string storyName, string storyDescription)
        {
            StoryNameTextBox.Text        = storyName;
            StoryDescriptionTextBox.Text = storyDescription;

            CreateButton.Click();
        }
Ejemplo n.º 2
0
 public void CreateScreeeningnohours()
 {
     CreateScreeening.Click();
     MovieId.SendKeys("2");
     DateTime1.SendKeys(RandomDate().ToString(" HH:00"));
     CreateButton.Click();
 }
Ejemplo n.º 3
0
 public void CreateScreeeningnodate()
 {
     CreateScreeening.Click();
     MovieId.SendKeys("2");
     DateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy,"));
     CreateButton.Click();
 }
Ejemplo n.º 4
0
 public void FillReservationFieldsWithInvalidScreeningId(int userId, int InvalidScreeningId)
 {
     UserIdField.SendKeys(userId.ToString());
     ScreeningIdField.SendKeys(InvalidScreeningId.ToString());
     SeatsField.SendKeys("2");
     CreateButton.Click();
 }
        public void enterEmptyThenAcceptanceDetails(string given, string when)
        {
            GivenTextBox.Text = given;
            WhenTextBox.Text  = when;

            CreateButton.Click();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Fills in the extension details and click create.
 /// </summary>
 public void FillInExtensionDetailsAndClickCreate()
 {
     PageHelper.SelectValueFromDropdown(Site, "San Clinical Trials Unit");
     PageHelper.SelectValueFromDropdown(Extension_ReportingPeriod, "2015");
     Driver.ExecuteJavaScript(@"$('#Extension_ExtensionDate').val('01/01/2018')");
     CreateButton.Click();
 }
        public void enterCorrectAcceptanceDetails(string given, string when, string then)
        {
            GivenTextBox.Text = given;
            WhenTextBox.Text  = when;
            ThenTextBox.Text  = then;

            CreateButton.Click();
        }
Ejemplo n.º 8
0
 public void FillTitleContent(string title, string content)
 {
     TitleField.Clear();
     TitleField.SendKeys(title);
     ContentField.Clear();
     ContentField.SendKeys(content);
     CreateButton.Click();
 }
Ejemplo n.º 9
0
        public void FillReservationFieldsWithInvalidSeatsNumber(int userId, int seats)
        {
            //Available screening check
            int screeningID = screeningRepository.SelectAvailableScreeningId();

            UserIdField.SendKeys(userId.ToString());
            ScreeningIdField.SendKeys(screeningID.ToString());
            SeatsField.SendKeys(seats.ToString());
            CreateButton.Click();
        }
Ejemplo n.º 10
0
 public void CreateScreeeningEditButton()
 {
     CreateScreeening.Click();
     MovieId.SendKeys("2");
     DateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy, 15:15"));
     CreateButton.Click();
     EditCreateScreeningButton.Click();
     dateTime1.Clear();
     dateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy HH:00"));
     SaveButton.Click();
 }
        public ConfigureApplicationPage CreateApplication(string name)
        {
            NavigateToPage();

            ApplicationNameField.Clear();
            ApplicationNameField.SendKeys(name);

            CreateButton.Click();

            return(this);
        }
        public void ClickCreate()
        {
            // Wait for the create button to be enabled
            WaitFor(CreateButton, btn => btn.Element.Current.IsEnabled);

            // Wait for Locations and Databases to have a selection
            // (the create button may be enabled before they are populated)
            WaitFor(LocationComboBox, combobox => combobox.GetSelectedItemName() != null);
            WaitFor(DatabaseComboBox, combobox => combobox.GetSelectedItemName() != null);

            WaitForInputIdle();
            WaitForClosed(TimeSpan.FromSeconds(180.0), () => CreateButton.Click());
        }
Ejemplo n.º 13
0
        public string PublishCatalog(B2BEnvironment b2BEnvironment, string profileName, string identityName, CatalogType catalogType)
        {
            SelectOptionFromDropDown(SelectCustomerProfileDiv, profileName);
            SelectOptionFromDropDown(SelectProfileIdentityDiv, identityName.ToUpper());

            if (!UseExistingB2BAutoScheduleRadioButton.Selected)
            {
                UseExistingB2BAutoScheduleRadioButton.Click();
            }

            SelectCatalogTypeOrginalOrDelta(catalogType);

            CreateButton.Click();

            WaitForFeedBackMessage(TimeSpan.FromMinutes(2));
            return(FeedBackMessage.Text);
        }
Ejemplo n.º 14
0
        public void FillReservationFieldsWithInvalidUserId(int InvalidUserId)
        {
            //Available screening check
            int screeningID = screeningRepository.SelectAvailableScreeningId();

            //Enough seats number check
            bool screeningCheck = screeningRepository.EnoughtSeatsNumberCheck(screeningID);

            if (screeningCheck == false)
            {
                screeningRepository.CreateMoreSeatsForThisScreening(screeningID);
            }

            UserIdField.SendKeys(InvalidUserId.ToString());
            ScreeningIdField.SendKeys(screeningID.ToString());
            SeatsField.SendKeys("2");
            CreateButton.Click();
        }
Ejemplo n.º 15
0
        public void CreateValidReservation(int userId)
        {
            //Before creating new reservation:
            //1. Check if there are already created reservations by this user
            reservationRepository.ReservationFromThisUserCheck(userId);

            //2. Find available screening id
            int screeningID = screeningRepository.SelectAvailableScreeningId();

            //3. Check if there are enough number of seats for this screening
            bool screeningCheck = screeningRepository.EnoughtSeatsNumberCheck(screeningID);

            if (screeningCheck == false)
            {
                screeningRepository.CreateMoreSeatsForThisScreening(screeningID);
            }

            //Create new reservation
            UserIdField.SendKeys(userId.ToString());
            ScreeningIdField.SendKeys(screeningID.ToString());
            SeatsField.SendKeys("2");
            CreateButton.Click();
        }
Ejemplo n.º 16
0
 public void CreateScreeeningwithoutfillfield()
 {
     CreateScreeening.Click();
     CreateButton.Click();
 }
Ejemplo n.º 17
0
 public void ClickCreateButton()
 {
     NavigateTo();
     CreateButton.Click();
 }
Ejemplo n.º 18
0
 public void ClickCreateButton()
 {
     CreateButton.Click();
 }
 public void CreateArticleForm(Article article)
 {
     Title.SendKeys(article.Title);
     Content.SendKeys(article.Content);
     CreateButton.Click();
 }
Ejemplo n.º 20
0
 //Second Commit
 public void LogInAndClickCreateButton()
 {
     LogIn();
     CreateButton.Click();
 }
 public CreateIssuePage ClickCreateButton()
 {
     CreateButton.Click();
     return(this);
 }
Ejemplo n.º 22
0
        public void AddButton()
        {
            // /**********************Buttons*********************************************
            //Creating ButtonsName String
            //populating the test data to collections
            ExcelLib.PopulateInCollection(@"C:\Users\ReshNikesh\Desktop\Study\Testing\SeleniumPrac\FirstProj\TestData1.xlsx", "ButtonsPage");

            //Create Webelement for UserInterface
            //IWebElement Uinterface = GlobalDef.driver.FindElement(By.XPath("/ html / body / div[1] / div / div[2] / ul / li[5] / a"));
            //Uinterface.Click();
            //Page Factory Definition
            Uinterface.Click();


            //Create Webelement for Buttons
            //IWebElement UButtons = GlobalDef.driver.FindElement(By.XPath("/html/body/div[1]/div/div[2]/ul/li[5]/ul/li[3]/a"));
            //UButtons.Click();
            //PF
            UButtons.Click();
            Thread.Sleep(1000);
            // Buttons Page Verification
            //buttonHdr = GlobalDef.driver.FindElement(By.XPath("/html/body/div[2]/h2"));
            if (buttonHdr.Text == "Buttons")
            {
                //Console.WriteLine("Login Successfully, Test Passed");
                //Console.WriteLine("Navigate to Buttons Page Successful");

                Thread.Sleep(1000);
                //Create Webelement for AddNewRecord
                //IWebElement addNew = GlobalDef.driver.FindElement(By.XPath("/html/body/div[2]/div/div[1]/a"));
                //addNew.Click();
                //PF AddNew button Click
                addNew.Click();

                //Create Webelement for Create Option
                Thread.Sleep(1000);
                //IWebElement createNew = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[1]/span"));

                //Create Page Open verification
                if (createNew.Text == "Create")
                {
                    //Create Webelement for ButtonName
                    //IWebElement bName = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[2]/input"));
                    //bName.SendKeys(Buttonsname);
                    bName.SendKeys(ExcelLib.ReadData(2, "Buttonsname"));

                    //Create Webelement for ButtonDisplayTitle
                    //IWebElement bDisplayTitle = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[4]/input"));
                    // bDisplayTitle.SendKeys(BDispValue);
                    bDisplayTitle.SendKeys(ExcelLib.ReadData(2, "BDispValue"));

                    Thread.Sleep(1000);

                    //Create Webelement for ButtonLogo
                    // GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[6]/span/span/span[2]/span")).Click();
                    bLogo.Click();
                    //Explicit Wait
                    //Thread.Sleep(2000);
                    //driver.FindElement(By.XPath("/html/body/div[7]/div/ul/li[3]/table/tbody/tr/td[1]/div")).Click();

                    //Implicit Wait
                    //IList<IWebElement> cbl = GlobalDef.driver.FindElements(By.XPath("/html/body/div[7]/div/ul/li"));

                    try
                    {
                        foreach (IWebElement e in cbl)
                        {
                            if (e.Text.Contains(ExcelLib.ReadData(2, "BLogo")))
                            {
                                e.Click();
                                break;
                            }
                        }
                    }
                    catch
                    {
                        throw new NoSuchElementException("Can't find camera in Button Logo dropdown");
                    }


                    //Create Webelement for PreCondition
                    // IWebElement bPreCondition = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[8]/input"));
                    // bPreCondition.SendKeys(BPreCValue);
                    bPreCondition.SendKeys(ExcelLib.ReadData(2, "BPreCValue"));

                    //Create Webelement for NextScreen
                    // IWebElement bNextScreen = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[10]/span/span/span[2]/span"));
                    //var selectElement = new SelectElement(bNextScreen);
                    //selectElement.SelectByIndex(2);
                    bNextScreen.Click();
                    Thread.Sleep(1000);
                    //GlobalDef.driver.FindElement(By.XPath(".//*[@id='NEXT_SCREEN_DBID_listbox']/li[6]")).Click();
                    //PF
                    bNextScreenList.Click();

                    //Create Webelement for ValueUpdate
                    //IWebElement bValueUpdate = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[12]/input"));
                    //bValueUpdate.SendKeys(BValue);
                    bValueUpdate.SendKeys(ExcelLib.ReadData(2, "BValue"));

                    //Create Webelement for NextState
                    //IWebElement bNextState = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[14]/span/span/span[1]"));
                    //selectElement = new SelectElement(bNextState);
                    //selectElement.SelectByIndex(2);
                    bNextState.Click();
                    Thread.Sleep(1000);
                    //GlobalDef.driver.FindElement(By.XPath("//*[@id='NEXT_STATE_DBID_listbox']/li[3]")).Click();
                    //PF
                    bNextStateList.Click();

                    //Create Webelement for PendingState
                    //IWebElement bPendingState = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[16]/span/span/span[2]"));
                    Thread.Sleep(1000);
                    bPendingState.Click();
                    Thread.Sleep(2000);
                    //GlobalDef.driver.FindElement(By.XPath("//*[@id='PENDING_STATE_DBID_listbox']/li[3]")).Click();
                    //PF
                    bPendingStateList.Click();

                    //Create Webelement for Entity Type
                    //IWebElement bEntityType = GlobalDef.driver.FindElement(By.XPath("html/body/div[6]/div[2]/div/div[18]/span/span/span[2]"));
                    // selectElement = new SelectElement(bEntityType);
                    //selectElement.SelectByIndex(3);
                    Thread.Sleep(1000);
                    bEntityType.Click();
                    Thread.Sleep(2000);
                    //GlobalDef.driver.FindElement(By.XPath("//*[@id='ETT_DBID_listbox']/li[3]")).Click();
                    //PF
                    bEntityTypeList.Click();

                    //Create Webelement for Override theme
                    //IWebElement bOverride = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[20]/span[1]/span/span[1]"));
                    bOverride.Click();
                    Thread.Sleep(2000);
                    //GlobalDef.driver.FindElement(By.XPath("/html/body/div[12]/div/ul/li[1]")).Click();
                    //PF
                    bOverrideList.Click();

                    /**************************Web element not identified, NOT WORKING*********************/
                    ////Create Webelement for BG Color
                    //IWebElement bBGColor = driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[22]/span/span/span[2]/span"));
                    //bBGColor.Click();
                    //System.Threading.Thread.Sleep(1000);

                    //Actions action = new Actions(driver);
                    //System.Threading.Thread.Sleep(1000);
                    //IWebElement slider = driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[22]/span/span/span[1]"));
                    //System.Threading.Thread.Sleep(1000);
                    //action.MoveToElement(slider, 200, 100).Click().Build().Perform();
                    //    //MoveToElement(slider,100,16).Click().Build().Perform();
                    //System.Threading.Thread.Sleep(1000);

                    //AddNew Screenshot
                    GlobalDef.SaveScreenshot(GlobalDef.driver, "AddNewPage");

                    //Create Webelement for Create button
                    //IWebElement CreateButton = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[27]/a[1]"));
                    CreateButton.Click();
                    Thread.Sleep(2500);
                    string ststr1r;
                    IAlert alert = GlobalDef.driver.SwitchTo().Alert();
                    ststr1r = alert.Text;
                    alert.Accept();
                    //Verifying the Newly Added record

                    if (buttonHdr.Text == "Buttons" && ststr1r.ToLowerInvariant().Contains("create record is success"))
                    {
                        //Explicit Wait for 2 sec
                        Thread.Sleep(2000);
                        /********PF to be done from here*/
                        //Filter button using Buttons Name
                        GlobalDef.driver.FindElement(By.XPath(".//*[@id='grid']/div[3]/div/table/thead/tr/th[1]/a[1]/span")).Click();

                        Thread.Sleep(1000);

                        //Enter the filter value
                        GlobalDef.Textbox(GlobalDef.driver, "XPath", "/html/body/div[5]/form/div[1]/input[1]", ExcelLib.ReadData(2, "Buttonsname"));

                        //Click on Filter button
                        GlobalDef.ActionButton(GlobalDef.driver, "XPath", "html/body/div[5]/form/div[1]/div[2]/button[1]");

                        //Create Webelement for Edit button in the grid
                        //editbGrid = GlobalDef.driver.FindElement(By.XPath(".//*[@id='grid']/div[4]/table/tbody/tr[1]/td[14]/a[1]"));

                        //Create Webelement for Delete button in the grid
                        //deletebGrid = GlobalDef.driver.FindElement(By.XPath(".//*[@id='grid']/div[4]/table/tbody/tr[1]/td[14]/a[2]"));

                        //Create Webelement for Buttonname in the grid
                        // buttonNameGrid = GlobalDef.driver.FindElement(By.XPath(".//*[@id='grid']/div[4]/table/tbody/tr/td[1]"));
                        if (buttonNameGrid.Text.ToLowerInvariant() == ExcelLib.ReadData(2, "Buttonsname").ToLowerInvariant() && editbGrid.Text == "Edit" && deletebGrid.Text == "Delete")
                        {
                            //AddNew Successful Screenshot
                            GlobalDef.SaveScreenshot(GlobalDef.driver, "AddNewSuccessfulPage");


                            Console.WriteLine("Navigate to Buttons Page Successful");
                            Console.WriteLine("Create Page Open successfully");
                            Console.WriteLine("Created new record successfully");
                            //Logging Status in Test Report
                            //ButtonsPageTests.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Button Added, Test Passed");
                            SpecFlow.ButtonsSpecFlowFeatureSteps.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Button Added, Test Passed");
                        }
                        else
                        {
                            Console.WriteLine("Login Successfully, Test Passed");
                            Console.WriteLine("Navigate to Buttons Page Successful");
                            Console.WriteLine("Create Page Open successfully");
                            Console.WriteLine("Button Name is not correct");
                            //Logging Status in Test Report
                            // ButtonsPageTests. for NUnit
                            SpecFlow.ButtonsSpecFlowFeatureSteps.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Button Name not added correctly, Test Failed");
                        }
                    }
                    else
                    {
                        Console.WriteLine("Login Successfully, Test Passed");
                        Console.WriteLine("Navigate to Buttons Page Successful");
                        Console.WriteLine("Create Page Open successfully");
                        Console.WriteLine("Record not created successfully, Record was already present. Please check");
                        //Logging Status in Test Report
                        // ButtonsPageTests. for Nunit
                        SpecFlow.ButtonsSpecFlowFeatureSteps.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Button not created, it was already present, Test Failed");
                    }
                }
                else
                {
                    Console.WriteLine("Create Page not available, Test Fail");
                    //Logging Status in Test Report
                    //  ButtonsPageTests.
                    SpecFlow.ButtonsSpecFlowFeatureSteps.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Create Page not available, Test Failed");
                }
            }
            else
            {
                Console.WriteLine("Buttons Page not available, Test Fail");
                //Logging Status in Test Report
                //  ButtonsPageTests.
                SpecFlow.ButtonsSpecFlowFeatureSteps.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Buttons Page not available, Test Failed");
            }
        }
Ejemplo n.º 23
0
        //POM Def
        //public IWebElement editbGrid;
        //public IWebElement deletebGrid;
        //public IWebElement buttonNameGrid;
        // public IWebElement buttonHdr;

        public void AddMultipleButton(int count)
        {
            //populating the test data to collections
            ExcelLib.PopulateInCollection(@"C:\Users\ReshNikesh\Desktop\Study\Testing\SeleniumPrac\FirstProj\TestData1.xlsx", "ButtonsPage");


            //Create Webelement for UserInterface
            //IWebElement Uinterface = GlobalDef.driver.FindElement(By.XPath("/ html / body / div[1] / div / div[2] / ul / li[5] / a"));
            //Uinterface.Click();
            //Adding Multiple Records
            for (int row = 2; row <= count + 1; row++)
            {
                //Page Factory Definition
                Uinterface.Click();


                //Create Webelement for Buttons
                //IWebElement UButtons = GlobalDef.driver.FindElement(By.XPath("/html/body/div[1]/div/div[2]/ul/li[5]/ul/li[3]/a"));
                //UButtons.Click();
                //PF
                UButtons.Click();
                Thread.Sleep(1000);
                // Buttons Page Verification
                //buttonHdr = GlobalDef.driver.FindElement(By.XPath("/html/body/div[2]/h2"));



                if (buttonHdr.Text == "Buttons")
                {
                    //Console.WriteLine("Login Successfully, Test Passed");
                    //Console.WriteLine("Navigate to Buttons Page Successful");

                    Thread.Sleep(500);
                    //Create Webelement for AddNewRecord
                    //IWebElement addNew = GlobalDef.driver.FindElement(By.XPath("/html/body/div[2]/div/div[1]/a"));
                    //addNew.Click();
                    //PF AddNew button Click
                    addNew.Click();

                    //Create Webelement for Create Option
                    Thread.Sleep(1000);
                    //IWebElement ButtonNameLabel = GlobalDef.driver.FindElement(By.XPath("/html/body/div[7]/div[2]"));
                    //IWebElement ButtonNameLabel1 = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]"));

                    //Create Page Open verification
                    if (bName.Displayed || createNew.Text == "Create")
                    {
                        //Create Webelement for ButtonName
                        //IWebElement bName = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[2]/input"));
                        //bName.SendKeys(Buttonsname);
                        bName.SendKeys(ExcelLib.ReadData(row, "Buttonsname"));

                        //Create Webelement for ButtonDisplayTitle
                        //IWebElement bDisplayTitle = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[4]/input"));
                        // bDisplayTitle.SendKeys(BDispValue);
                        bDisplayTitle.SendKeys(ExcelLib.ReadData(row, "BDispValue"));

                        Thread.Sleep(1000);

                        //Create Webelement for ButtonLogo
                        // GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[6]/span/span/span[2]/span")).Click();
                        //PF
                        bLogo.Click();
                        //Explicit Wait
                        //Thread.Sleep(2000);
                        //driver.FindElement(By.XPath("/html/body/div[7]/div/ul/li[3]/table/tbody/tr/td[1]/div")).Click();

                        //Implicit Wait
                        //IList<IWebElement> cbl = GlobalDef.driver.FindElements(By.XPath("/html/body/div[7]/div/ul/li"));

                        try
                        {
                            foreach (IWebElement e in cbl)
                            {
                                if ((e.Text.ToLowerInvariant()).Contains(ExcelLib.ReadData(row, "BLogo").ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find camera in Button Logo dropdown");
                        }


                        //Create Webelement for PreCondition
                        // IWebElement bPreCondition = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[8]/input"));
                        // bPreCondition.SendKeys(BPreCValue);
                        bPreCondition.SendKeys(ExcelLib.ReadData(row, "BPreCValue"));

                        //Create Webelement for NextScreen
                        bNextScreen.Click();
                        IList <IWebElement> nS1 = GlobalDef.driver.FindElements(By.XPath("//*[@id='NEXT_SCREEN_DBID_listbox']/li"));
                        try
                        {
                            foreach (IWebElement e in nS1)
                            {
                                if ((ExcelLib.ReadData(row, "NextScreen").ToLowerInvariant()).Equals(e.Text.ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find" + ExcelLib.ReadData(row, "NextScreen") + " in NextScreen dropdown");
                        }

                        // IWebElement bNextScreen = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[10]/span/span/span[2]/span"));
                        //var selectElement = new SelectElement(bNextScreen);
                        //selectElement.SelectByIndex(2);
                        //PF//  bNextScreen.Click();
                        //PF Thread.Sleep(1000);
                        //GlobalDef.driver.FindElement(By.XPath(".//*[@id='NEXT_SCREEN_DBID_listbox']/li[6]")).Click();
                        //PF
                        //  bNextScreenList.Click();

                        //Create Webelement for ValueUpdate
                        //IWebElement bValueUpdate = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[12]/input"));
                        //bValueUpdate.SendKeys(BValue);
                        bValueUpdate.SendKeys(ExcelLib.ReadData(row, "BValue"));

                        //Create Webelement for NextState
                        bNextState.Click();
                        IList <IWebElement> nS = GlobalDef.driver.FindElements(By.XPath("//*[@id='NEXT_STATE_DBID_listbox']/li"));
                        try
                        {
                            foreach (IWebElement e in nS)
                            {
                                if ((ExcelLib.ReadData(row, "NextState").ToLowerInvariant()).Equals(e.Text.ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find" + ExcelLib.ReadData(row, "NextState") + " in NextState dropdown");
                        }
                        //IWebElement bNextState = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[14]/span/span/span[1]"));
                        //selectElement = new SelectElement(bNextState);
                        //selectElement.SelectByIndex(2);
                        //PF
                        //bNextState.Click();
                        Thread.Sleep(1000);
                        //GlobalDef.driver.FindElement(By.XPath("//*[@id='NEXT_STATE_DBID_listbox']/li[3]")).Click();
                        //PF
                        // bNextStateList.Click();

                        //Create Webelement for PendingState
                        bPendingState.Click();
                        IList <IWebElement> pS = GlobalDef.driver.FindElements(By.XPath("//*[@id='PENDING_STATE_DBID_listbox']/li"));
                        try
                        {
                            foreach (IWebElement e in pS)
                            {
                                if ((ExcelLib.ReadData(row, "PendingState").ToLowerInvariant()).Equals(e.Text.ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find" + ExcelLib.ReadData(row, "PendingState") + " in PendingState dropdown");
                        }

                        //IWebElement bPendingState = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[16]/span/span/span[2]"));
                        //Thread.Sleep(1000);
                        //PF
                        //bPendingState.Click();
                        Thread.Sleep(2000);
                        //GlobalDef.driver.FindElement(By.XPath("//*[@id='PENDING_STATE_DBID_listbox']/li[3]")).Click();
                        //PF
                        // bPendingStateList.Click();

                        //Create Webelement for Entity Type
                        GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[18]/span/span/span[2]/span")).Click();
                        IList <IWebElement> eT = GlobalDef.driver.FindElements(By.XPath("//*[@id='ETT_DBID_listbox']/li"));
                        try
                        {
                            foreach (IWebElement e in eT)
                            {
                                if ((ExcelLib.ReadData(row, "Entity Type").ToLowerInvariant()).Equals(e.Text.ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find" + ExcelLib.ReadData(row, "Entity Type") + " in Entity type dropdown");
                        }
                        Thread.Sleep(1000);
                        //bEntityType.Click();
                        //Thread.Sleep(2000);
                        //GlobalDef.driver.FindElement(By.XPath("//*[@id='ETT_DBID_listbox']/li[3]")).Click();
                        //PF
                        //bEntityTypeList.Click();

                        //Create Webelement for Override theme
                        //IWebElement bOverride = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[20]/span[1]/span/span[1]"));
                        //PF // bOverride.Click();
                        IList <IWebElement> oD = GlobalDef.driver.FindElements(By.XPath("/html/body/div[12]/div/ul/li"));
                        try
                        {
                            foreach (IWebElement e in oD)
                            {
                                if ((ExcelLib.ReadData(row, "Override").ToLowerInvariant()).Equals(e.Text.ToLowerInvariant()))
                                {
                                    e.Click();
                                    break;
                                }
                            }
                        }
                        catch
                        {
                            throw new NoSuchElementException("Can't find" + ExcelLib.ReadData(row, "Override") + " in Override dropdown");
                        }
                        // Thread.Sleep(2000);
                        //GlobalDef.driver.FindElement(By.XPath("/html/body/div[12]/div/ul/li[1]")).Click();
                        //PF
                        // bOverrideList.Click();


                        //Create Webelement for Create button
                        //IWebElement CreateButton = GlobalDef.driver.FindElement(By.XPath("/html/body/div[6]/div[2]/div/div[27]/a[1]"));
                        CreateButton.Click();
                        Thread.Sleep(2500);
                        string ststr1r;
                        IAlert alert = GlobalDef.driver.SwitchTo().Alert();
                        ststr1r = alert.Text;
                        alert.Accept();
                        //Verifying the Newly Added record
                        if (buttonHdr.Text == "Buttons" && ststr1r.ToLowerInvariant().Contains("create record is success"))
                        {
                            //Explicit Wait for 2 sec
                            Thread.Sleep(2000);

                            //Filter button using Buttons Name
                            GlobalDef.driver.FindElement(By.XPath(".//*[@id='grid']/div[3]/div/table/thead/tr/th[1]/a[1]/span")).Click();

                            Thread.Sleep(1000);

                            //Enter the filter value
                            GlobalDef.Textbox(GlobalDef.driver, "XPath", "/html/body/div[5]/form/div[1]/input[1]", ExcelLib.ReadData(row, "Buttonsname"));

                            //Click on Filter button
                            GlobalDef.ActionButton(GlobalDef.driver, "XPath", "html/body/div[5]/form/div[1]/div[2]/button[1]");
                            GlobalDef.driver.FindElement(By.XPath("//*[@id='grid']/div[5]/a[5]")).Click();
                            //string test = ExcelLib.ReadData(row, "Buttonsname");
                            //string bg = GlobalDef.driver.FindElement(By.XPath("//*[@id='grid']/div[4]/table/tbody/tr/td[1]")).Text;
                            ////buttonNameGrid.Text.Contains(test)
                            if (buttonNameGrid.Text.Equals(ExcelLib.ReadData(row, "Buttonsname")))
                            {
                                //AddNew Successful Screenshot
                                GlobalDef.SaveScreenshot(GlobalDef.driver, ExcelLib.ReadData(row, "Buttonsname") + " AddNewSuccessfulPage");

                                Console.WriteLine("Created {0} Button record successfully", ExcelLib.ReadData(row, "Buttonsname"));
                            }
                            else
                            {
                                Console.WriteLine("Login Successfully, Test Passed");
                                Console.WriteLine("Navigate to Buttons Page Successful");
                                Console.WriteLine("Create Page Open successfully");
                                Console.WriteLine("Button Name {0} is not saved correctly", ExcelLib.ReadData(row, "Buttonsname"));
                            }
                        }
                        else
                        {
                            Console.WriteLine("Login Successfully, Test Passed");
                            Console.WriteLine("Navigate to Buttons Page Successful");
                            Console.WriteLine("Create Page Open successfully");
                            Console.WriteLine("Record not created successfully, Record was already present. Please check");
                        }
                    }
                    else
                    {
                        Console.WriteLine("Create Page not available, Test Fail");
                    }
                }
                else
                {
                    Console.WriteLine("Buttons Page not available, Test Fail");
                }
            }
        }
Ejemplo n.º 24
0
 public WorkItem CreateButtonClick()
 {
     CreateButton.Click();
     return(new WorkItem());
 }
Ejemplo n.º 25
0
 public GenericEntityEditPage ClickCreateButton()
 {
     CreateButton.Click();
     return(new GenericEntityEditPage(_entityName, contextConfiguration));
 }