示例#1
0
 public void FillTransferMoneyAndMakePayment(string FromAcc, string ToAcc, string Amount, string Description)
 {
     SeleniumSetMethods.SelectDropDown(optFromAccount, FromAcc);
     SeleniumSetMethods.SelectDropDown(optToAccount, ToAcc);
     SeleniumSetMethods.EnterText(txtAmount, Amount);
     SeleniumSetMethods.EnterText(txtDescription, Description);
 }
示例#2
0
        public void GivenIAddedSauceLabsBackpackToCart()
        {
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='inventory_container']/div/div[1]/div[3]/button")));
            SeleniumSetMethods.Clicks(SaucedemoInventoryPageObjects.buttonaddtocart);
        }
        public static void SearchProduct(string search)
        {
            Console.WriteLine("Textbox 'Search':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(txtSearch);

            SeleniumSetMethods.StepStart("Clears textbox 'Search'.", "3");
            SeleniumSetMethods.Clears(txtSearch);
            SeleniumSetMethods.ElementEmpty(txtSearch);

            SeleniumSetMethods.StepStart("Enters text 'Razer Laptop' in 'Search' textbox.", "4");
            SeleniumSetMethods.EnterText(txtSearch, search);
            string enteredtext = SeleniumGetMethods.GetValue(txtSearch);

            SeleniumGetMethods.VerifyText(enteredtext, search);
            Console.WriteLine("Button 'Search':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(btnSearch);

            SeleniumSetMethods.StepStart("Submits button 'Search'.", "5");
            SeleniumSetMethods.Submits(btnSearch);
            string urlSearch = WebDriver.driver.Url;

            SeleniumSetMethods.WaitForPageToLoad(WebDriver.driver, 35);
            SeleniumGetMethods.PageLoaded(urlSearch, "search");
            Console.WriteLine("Searched Links web shop for '{0}'!", search);
        }
示例#4
0
        public void WhenIClickMenu()
        {
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("react-burger-menu-btn")));
            SeleniumSetMethods.Clicks(SaucedemoCartPageObjects.buttonMenu);
        }
示例#5
0
        public void TestMoneyTransaction()
        {
            Thread.Sleep(2000);

            foreach (var pencil in PencilsCredCardAndWiretransferDetails)
            {
                pencil.Click();
            }
            SeleniumGetMethod.WaitForPageLoad(driver);

            foreach (var input in AllInputsCredCardWiretransfer)
            {
                input.SendKeys(Helpers.Randomizer.String(5, letters) + Helpers.Randomizer.String(3, digits));
                Thread.Sleep(1000);
            }

            foreach (var drl in AllDropDownsCredCardWiretransfer)
            {
                SeleniumSetMethods.SelectDropDownRandom(drl);
                Thread.Sleep(1000);
            }

            foreach (var apply in BtnApplyFor2Forms)
            {
                apply.Click();
                Thread.Sleep(2000);
            }
            SeleniumGetMethod.WaitForPageLoad(driver);
            Thread.Sleep(2000);
        }
示例#6
0
        public void TimeOutModal()
        {
            SeleniumSetMethods.WaitOnPage(60);
            SeleniumSetMethods.WaitOnPage(60);
            SeleniumSetMethods.WaitOnPage(60);
            SeleniumSetMethods.WaitOnPage(29);
            SeleniumSetMethods.WaitOnPage(29);
            TimeoutModalPage TimeOutPg = new TimeoutModalPage(webDriver);
            String           Timeout1  = TimeOutPg.RemainingTime().Text;
            string           Title     = TimeOutPg.TimeOutModalTitle().Text;

            bool isClockIconDisplayed  = TimeOutPg.ClockIcon().Displayed;
            bool isKeepMySessionButton = TimeOutPg.KeepMySessionBTN().Displayed;
            bool isEndMySessionButton  = TimeOutPg.EndMySessionBTN().Displayed;
            bool isRemainingTime       = TimeOutPg.RemainingTime().Displayed;

            Console.WriteLine(isClockIconDisplayed);
            Console.WriteLine(isKeepMySessionButton);
            Console.WriteLine(isEndMySessionButton);
            Console.WriteLine(isRemainingTime);
            Console.WriteLine(TimeOutPg.ClockIcon().Text);
            Console.WriteLine(TimeOutPg.KeepMySessionBTN().Text);
            Console.WriteLine(TimeOutPg.EndMySessionBTN().Text);
            Console.WriteLine(TimeOutPg.RemainingTime().Text);

            webDriver.PageSource.Contains(TimeOutPg.ClockIcon().Text);
            webDriver.PageSource.Contains(TimeOutPg.KeepMySessionBTN().Text);
            webDriver.PageSource.Contains(TimeOutPg.EndMySessionBTN().Text);
            webDriver.PageSource.Contains(TimeOutPg.RemainingTime().Text);
            webDriver.PageSource.Contains("For security, your session with billzy is about to time-out.");
            webDriver.PageSource.Contains("Would you like to remain logged in?");
        }
示例#7
0
        public void WhenISubmitLOGINButton()
        {
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("login-button")));
            SeleniumSetMethods.Submits(SaucedemoLogInPageObjects.buttonLOGIN);
        }
示例#8
0
 public void PopulateAddNewPayeeForm(string PayeeName, string PayeeAddress, string PayeeAccount, string PayeeDetails)
 {
     SeleniumSetMethods.EnterText(txtPayeeName, PayeeName);
     SeleniumSetMethods.EnterText(txtPayeeAddress, PayeeAddress);
     SeleniumSetMethods.EnterText(txtPayeeAccount, PayeeAccount);
     SeleniumSetMethods.EnterText(txtPayeeDetails, PayeeDetails);
 }
        public static void CartPage()
        {
            SeleniumSetMethods.StepStart("Loads web page (https://www.saucedemo.com/cart.html).", "1");
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "cart");
            Console.WriteLine("Menu button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonMenu);
            Console.WriteLine("Cart button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonCart);
            string text = SeleniumGetMethods.GetText(textcart);

            SeleniumGetMethods.VerifyText(text, "1");
            Console.WriteLine("Main text:");
            text = SeleniumGetMethods.GetText(textMain);
            SeleniumGetMethods.VerifyText(text, "Your Cart");
            Console.WriteLine("'QTY' text:");
            text = SeleniumGetMethods.GetText(textQuantity);
            SeleniumGetMethods.VerifyText(text, "QTY");
            Console.WriteLine("'DESCRIPTION' text:");
            text = SeleniumGetMethods.GetText(textDescription);
            SeleniumGetMethods.VerifyText(text, "DESCRIPTION");
            SeleniumGetMethods.VerifyProduct(cartproductcontainer, "1\nSauce Labs Backpack\ncarry.allTheThings() with the sleek, streamlined Sly Pack that melds uncompromising style with unequaled laptop and tablet protection.\n29.99REMOVE");
            Console.WriteLine("'CONTINUE SHOPPING' button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonContinue);
            Console.WriteLine("'CHECKOUT' button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonCheckout);
            Console.WriteLine("Twitter button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonTwitter);
            Console.WriteLine("Fcebook button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonFacebook);
            Console.WriteLine("LinkedIn button:");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonLinkedIn);
            text = SeleniumGetMethods.GetText(textBottom);
            SeleniumGetMethods.VerifyText(text, "© 2021 Sauce Labs. All Rights Reserved. Terms of Service | Privacy Policy");

            SeleniumSetMethods.StepStart("Clicks Menu button.", "2");
            SeleniumSetMethods.Clicks(buttonMenu);
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='menu_button_container']/div/div[3]/div[2]/div")));
            Console.WriteLine("Button 'X':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonX);
            Console.WriteLine("Button 'All Items':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonAllItems);
            Console.WriteLine("Button 'About':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonAbout);
            Console.WriteLine("Button 'Logout':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonLogout);
            Console.WriteLine("Button 'Reset App State':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(buttonResetAppState);

            SeleniumSetMethods.StepStart("Clicks button 'X' ", "3");
            SeleniumSetMethods.Clicks(buttonX);
            Thread.Sleep(2000);
            SeleniumSetMethods.ElementHidden(buttonX);

            SeleniumSetMethods.StepStart("Clicks 'CHECKOUT' button.", "4");
            SeleniumSetMethods.Clicks(buttonCheckout);
            SeleniumSetMethods.WaitForPageToLoad(WebDriver.driver, 35);
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "checkout-step-one");
        }
示例#10
0
        public void ThenMenuIsDisplayed()
        {
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("react-burger-cross-btn")));
            SeleniumSetMethods.ElementHidden(SaucedemoCartPageObjects.buttonX);
        }
示例#11
0
        public void GivenIEnteredCorrectPassword(string p0)
        {
            this.CorrectPassword = p0;
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Name("password")));
            SeleniumSetMethods.EnterText(SaucedemoLogInPageObjects.textboxPassword, CorrectPassword);
        }
示例#12
0
        public void GivenIEnteredCorrectUsername(string p0)
        {
            this.CorrectUsername = p0;
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("user-name")));
            SeleniumSetMethods.EnterText(SaucedemoLogInPageObjects.textboxUsername, CorrectUsername);
        }
示例#13
0
 public virtual void CheckSearch()
 {
     foreach (var drl in SearchFormDropDowns)
     {
         SeleniumSetMethods.SelectDropDown(drl, 1);
         SeleniumGetMethod.WaitForPageLoad(driver);
         Thread.Sleep(2000);
     }
     foreach (var field in SearchFormInputs)
     {
         field.SendKeys(Helpers.Randomizer.String(7));
     }
     SeleniumGetMethod.WaitForPageLoad(driver);
     Thread.Sleep(3000);
     for (int i = 0; i < SearchFormCreatedDate.Count; i++)
     {
         SeleniumGetMethod.WaitForElement(driver, SearchFormCreatedDate[i]);
         SearchFormCreatedDate[i].Click();
         try
         {
             foreach (var date in CalendarBoxFromTo)
             {
                 if (date.Displayed)
                 {
                     date.Clear();
                     date.SendKeys(WindowsMessages.GetCurDate(1));
                     SeleniumGetMethod.WaitForPageLoad(driver);
                 }
             }
             if (BtnApply[i].Displayed)
             {
                 SeleniumGetMethod.WaitForElement(driver, BtnApply[i]);
                 BtnApply[i].Click();
                 SeleniumGetMethod.WaitForPageLoad(driver);
                 Thread.Sleep(1000);
                 SeleniumGetMethod.WaitForPageLoad(driver);
             }
         }
         catch (Exception msg)
         {
             PropertiesCollection._reportingTasks.Log(Status.Info, "Can't manipulate calendarboxes..<br>" + msg.ToString());
         }
     }
     Thread.Sleep(2000);
     BtnSearch.Click();
     SeleniumGetMethod.WaitForPageLoad(driver);
     Thread.Sleep(2000);
     try
     {
         xClearAllFilters.Click();
         Thread.Sleep(2000);
     }
     catch (Exception msg)
     {
         PropertiesCollection._reportingTasks.Log(Status.Info, "Can't set null filters uisng x(cross) link...<br>" + msg.ToString());
     }
     SeleniumGetMethod.WaitForPageLoad(driver);
 }
示例#14
0
        public void GivenINavigateToCartPage()
        {
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "inventory");
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='shopping_cart_container']/a")));
            SeleniumSetMethods.Clicks(SaucedemoCartPageObjects.buttonCart);
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "cart");
        }
示例#15
0
 public void PopulateFindTransactionsForm(string Description, string FromDates, string ToDates, string FromAmount, string ToAmount, string Type)
 {
     SeleniumSetMethods.EnterText(txtAaDescription, Description);
     SeleniumSetMethods.EnterText(txtAaFromDate, FromDates);
     SeleniumSetMethods.EnterText(txtAaToDate, ToDates);
     SeleniumSetMethods.EnterText(txtAaFromAmount, FromAmount);
     SeleniumSetMethods.EnterText(txtAaToAmount, ToAmount);
     SeleniumSetMethods.SelectDropDown(ddmAaType, Type);
 }
        public void ThenSelectTitle()
        {
            _driver.SwitchTo().Window(_driver.WindowHandles.Last());
            var selectTitle = _driver.FindElement(By.Id("TitleId"));

            SeleniumSetMethods.SelectDropDown(_driver, "TitleId", "Mr.", "Id");
            Thread.Sleep(1000);
            //_driver.Close();
            //_driver.SwitchTo().Window(parentwindow);
        }
示例#17
0
        public void GivenILoggedIn()
        {
            WebDriver.driver.Navigate().GoToUrl("https://www.saucedemo.com/");
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "saucedemo");
            var wait = new WebDriverWait(WebDriver.driver, TimeSpan.FromSeconds(2));

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("login-button")));
            SeleniumSetMethods.EnterText(SaucedemoLogInPageObjects.textboxUsername, "standard_user");
            SeleniumSetMethods.EnterText(SaucedemoLogInPageObjects.textboxPassword, "secret_sauce");
            SeleniumSetMethods.Submits(SaucedemoLogInPageObjects.buttonLOGIN);
        }
示例#18
0
        public void PopulatePaymentToSavedPayees(string Payee, string Account, string Amount, string Date, string Description)
        {
            SeleniumSetMethods.SelectDropDown(ddmPayee, Payee);
            SeleniumSetMethods.SelectDropDown(ddmSpAccount, Account);
            SeleniumSetMethods.EnterText(txtSpAmount, Amount);
            SeleniumSetMethods.EnterText(txtSpDate, Date);
            AccountSummaryPage page = new AccountSummaryPage();

            page.txtSpAmount.Click();
            SeleniumSetMethods.EnterText(txtSpDescription, Description);
        }
示例#19
0
        public static void GetRole(UserRole userRole)
        {
            const int SELECT_ROLE_INDEX_IN_DOM = 4;
            const int SAVE_BUTTON_INDEX_IN_DOM = 5;
            var       tr     = SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(userRole.Username)));
            var       select = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SELECT_ROLE_INDEX_IN_DOM, tr));

            SeleniumSetMethods.SelectDropDown(select, userRole.Role);
            Sincronize.Wait(2000);
            var save = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SAVE_BUTTON_INDEX_IN_DOM, tr));

            save.Click();
        }
示例#20
0
        public void FirstTest()
        {
            //Checking the state of TextBoxes and Button
            SeleniumGetMethods.UserNameTextboxCheck("Username", PropertyType.Name);
            SeleniumGetMethods.PasswordTextboxCheck("Password", PropertyType.Name);
            SeleniumGetMethods.LoginButtonCheck("action", PropertyType.Name);

            //Click on button "Prijava"
            SeleniumSetMethods.Click("action", PropertyType.Name);

            //Getting alert message from the website
            Console.WriteLine("Alert message: " + SeleniumGetMethods.GetText("/html/body/div[1]/div/div/div/div/div/div/div/div", PropertyType.CssName) + "\n");
        }
        public void BankAccountVerification02_UnverifiedAccountPAY()
        {
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                /* Bank Account Verification Scenarios -
                 * Verify cant pay with unverified bank account
                 */

                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");
                LoginPage       loginPage      = new LoginPage(WebDriver);
                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay8);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                ReceivedPage recpg = new ReceivedPage(WebDriver);
                recpg.SearchInvoiceReceived().SendKeys("INV10308526");
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.ActionsMenu().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.PAY().Click();
                PayNowPage Paynwpg = new PayNowPage(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Paynwpg.Row01SelectCard().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IWebElement bodyTag  = WebDriver.FindElement(By.TagName("body"));
                bool        banklist = bodyTag.Text.Contains("invalid");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(banklist == false);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
            finally
            {
            }
        }
示例#22
0
        public static void OrderByPriceAscendant()
        {
            SeleniumSetMethods.PerformMovement(Properties.driver, SeleniumGetMethods.GetElement(Properties.driver, "w7", "Id"));
            SeleniumSetMethods.Click(Properties.driver, "//*[@class='srp-sort__menu']/li[4]", "xpath");

            //printing first 5 results in console
            listproduct = SeleniumGetMethods.GetProductsFromList(Properties.driver, 5);

            foreach (Product element in listproduct)
            {
                PrintResults(element.GetTitle());
                PrintResults(element.GetPrice());
            }
        }
        public void GivenChildrensDetails()
        {
            // Titel for Children

            var liarrayelement = _driver.FindElements(By.CssSelector("li.underline"));
            // Thread.Sleep(5000);
            var           Child = liarrayelement[2];
            SelectElement ss    = new SelectElement(Child.FindElement(By.CssSelector("select")));

            //Thread.Sleep(3000);
            Console.WriteLine(ss.Options);
            foreach (IWebElement dropdownopt in ss.Options)
            {
                if (dropdownopt.Text == "Miss")
                {
                    dropdownopt.Click();
                }
            }
            // Passing Name for Child
            var ChildName      = _driver.FindElements(By.CssSelector(".form-control.passenger-first-name"));
            var ChildfirstName = ChildName[2];

            ChildfirstName.Click();
            ChildfirstName.SendKeys("Arisha");

            var Childmiddlename = _driver.FindElements(By.CssSelector(".form-control.passenger-middle-name"));
            var ChildmiddleName = Childmiddlename[2];

            ChildmiddleName.Click();
            ChildmiddleName.SendKeys("Samrish");

            var Childlastname = _driver.FindElements(By.CssSelector(".date-pick-years.form-control.passenger-last-name"));
            var ChildlastName = Childlastname[2];

            ChildlastName.Click();
            ChildlastName.SendKeys("Syed");

            //Child Age
            //var ChildAge = _driver.FindElements(By.CssSelector(".form-control.passenger-age.parsley-error"));
            //SelectElement ss = new SelectElement(_driver.FindElement(By.CssSelector(".form-control.passenger-age")));
            var childcollection = _driver.FindElements(By.CssSelector(".list-unstyled.booking-item-passengers.card.panel-account"));
            var childfield      = childcollection[1];
            var childdata       = childfield.FindElement(By.ClassName("underline"));

            //var childage = childdata.FindElement(By.ClassName("passenger-age"));
            // childage.Click();

            SeleniumSetMethods.SelectDropDown(_driver, ".form-control.passenger-age", "3", "CssSelector");
            Thread.Sleep(5000);
        }
示例#24
0
        public void ExecuteTest()
        {
            //Title
            SeleniumSetMethods.SelectDropDown("TitleId", "Mr.", PropertyType.Id);

            //Initial
            SeleniumSetMethods.EnterText("Initial", "executeautomation", PropertyType.Name);

            Console.WriteLine("The value from my Title is: " + SeleniumGetMethods.GetText("TitleId", PropertyType.Id));

            Console.WriteLine("The value from my Initial is: " + SeleniumGetMethods.GetText("Initial", PropertyType.Name));

            //Click
            SeleniumSetMethods.Click("Save", PropertyType.Name);
        }
示例#25
0
        public void ExecuteTest_CustomControlMethods()
        {
            //navigate to demo site page
            webDriver.Navigate().GoToUrl("http://executeautomation.com/demosite/index.html?UserName=&Password=&Login=Login");

            Console.WriteLine("Opened Demo Site URL");

            //title
            SeleniumSetMethods.SelectDropDown(webDriver, "TitleId", "Mr.", "Id");

            //initial
            SeleniumSetMethods.EnterText(webDriver, "Initial", "M", "Name");

            //first name
            SeleniumSetMethods.EnterText(webDriver, "FirstName", "Michael", "Name");

            //middle name
            SeleniumSetMethods.EnterText(webDriver, "MiddleName", "Lee", "Name");

            //gender
            SeleniumSetMethods.Click(webDriver, "Female", "Name");

            //languages
            SeleniumSetMethods.Click(webDriver, "Hindi", "Name");

            //save button
            SeleniumSetMethods.Click(webDriver, "Save", "Name");

            Console.WriteLine("Executed Save Values");

            Thread.Sleep(1000);

            Console.WriteLine("Get New Values");

            //title
            Console.WriteLine("Title: " + SeleniumGetMethods.GetTextFromDDL(webDriver, "TitleId", "Name"));

            //initial
            Console.WriteLine("Initial: " + SeleniumGetMethods.GetText(webDriver, "Initial", "Name"));

            //first name
            Console.WriteLine("First Name: " + SeleniumGetMethods.GetText(webDriver, "FirstName", "Name"));

            //middle name
            Console.WriteLine("Middle Name: " + SeleniumGetMethods.GetText(webDriver, "MiddleName", "Name"));

            Console.WriteLine("Executed Get New Values");
        }
        public static void SelectPCs()
        {
            SeleniumSetMethods.StepStart("Loads web page (https://www.links.hr/hr/).", "1");
            SeleniumGetMethods.PageLoaded(WebDriver.driver.Url, "links");

            Console.WriteLine("Button 'Računala':");
            SeleniumSetMethods.ElementDisplayedAndEnabled(btnRačunala);

            SeleniumSetMethods.StepStart("Clicks button 'Računala'.", "2");
            SeleniumSetMethods.MoveToElement(btnRačunala, WebDriver.driver);
            SeleniumSetMethods.Clicks(btnRačunala);
            string urlSorted = WebDriver.driver.Url;

            SeleniumSetMethods.WaitForPageToLoad(WebDriver.driver, 35);
            SeleniumGetMethods.PageLoaded(urlSorted, "racunala");
        }
示例#27
0
        public void FifthTest()
        {
            //Checking the state of TextBoxes and Button
            SeleniumGetMethods.UserNameTextboxCheck("Username", PropertyType.Name);
            SeleniumGetMethods.PasswordTextboxCheck("Password", PropertyType.Name);
            SeleniumGetMethods.LoginButtonCheck("action", PropertyType.Name);

            //Entering the correct Username
            SeleniumSetMethods.EnterText("Username", "tester12", PropertyType.Name);

            //Entering the correct Password
            SeleniumSetMethods.EnterText("Password", "Password1!", PropertyType.Name);

            //Click on button "Prijava"
            SeleniumSetMethods.Click("action", PropertyType.Name);
        }
示例#28
0
 //for future testing
 public void CheckFilters()
 {
     CreateFiltA.Click();
     Thread.Sleep(3000);
     for (int i = 0; i < FiltersDrls.Count; i++)
     {
         var allFlters = driver.FindElements(By.CssSelector("div.item.choosen-columns select[name]"));
         if (SeleniumGetMethod.GetQuantityOfOptionsInDropDown(allFlters[i]) < 2)
         {
             break;
         }
         SeleniumSetMethods.SelectDropDown(allFlters[i], i + 1);
         Thread.Sleep(2000);
     }
     BtnCancel.Click();
     Thread.Sleep(2000);
 }
示例#29
0
        public static void EditeProfile(UserProfile user)
        {
            UserProfilePageObjects userProfilePageObjects = new UserProfilePageObjects();

            SeleniumSetMethods.ChangeTextForWebElement(userProfilePageObjects.FirstName, user.FirstName);
            SeleniumSetMethods.ChangeTextForWebElement(userProfilePageObjects.LastName, user.LastName);
            SeleniumSetMethods.ChangeTextForWebElement(userProfilePageObjects.BirthDate, GetDate(user.BirthDate));
            SelectSex(user.Sex, userProfilePageObjects);
            SeleniumSetMethods.ChangeTextForWebElement(userProfilePageObjects.City, user.City);
            SeleniumSetMethods.ChangeTextForWebElement(userProfilePageObjects.Signature, user.Signature);

            if (ImageUtils.IsValidImage(FileUtils.CreateInputPath(user.Photo)))
            {
                userProfilePageObjects.Photo.SendKeys(FileUtils.CreateInputPath(user.Photo));
            }
            userProfilePageObjects.Save.Click();
            // userProfilePageObjects.Cancel.Click(); daca vreau sa renunt
        }
        public void AddDeleteCards02()
        {
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                WebDriver.Manage().Window.Maximize();

                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");

                LoginPage loginPage = new LoginPage(WebDriver);
                loginPage.UserNameTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay7);
                CardPage CardPg = new CardPage(WebDriver);

                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                HomePg.Profile().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.CardMgmnt().Click();
                SeleniumSetMethods.WaitOnPage(secdelay7);

                CardPg.DeleteCardbutton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
            }
            finally
            {
            }
        }