コード例 #1
0
        //Validate the functionality of 'Search' Button with valid data.

        internal void ValidateSearch()
        {
            ExcelLibHelpers.PopulateInCollection(Base.ExcelPath, "Search");
            AdvancedLnk.Click();
            KeywrdTxtbox.SendKeys(ExcelLibHelpers.ReadData(3, "searchKeyword"));
            BuyNowCheckbx.Click();
            AdvanceSearchBtn.Click();
            Thread.Sleep(4000);
            var ResultLbl = Driver.driver.FindElement(By.XPath("html/body/div[5]/div[2]/div[1]/div[1]/div/div[1]/div/div[1]/div/div[3]/h1")).Text;

            if (ResultLbl == ExcelLibHelpers.ReadData(2, "searchresult"))
            {
                Console.WriteLine("Test case Passed. 0 results found.");
            }
            else
            {
                for (var i = 1; i <= 50; i++)
                {
                    var SearchResult = Driver.driver.FindElement(By.XPath("html/body/div[5]/div[2]/div[1]/div[1]/div/div[1]/div/div[3]/div/div[1]/div/w-root/div/div/ul/li[" + i + "]/h3")).Text;
                    if (SearchResult.StartsWith(ExcelLibHelpers.ReadData(2, "searchKeyword")))
                    {
                        Console.WriteLine("Test case Passed. Searched record found.");
                        return;
                    }
                    else
                    {
                        Console.WriteLine("Test case Failed. Searched record not found.");
                    }
                }
            }
        }
コード例 #2
0
        public void LoginSteps(IWebDriver driver)
        {
            //Wait for login page to be loaded and 'Sign In' to become visible
            Wait.ElementIsVisible(driver, "XPath", "//*[@id='home']/div/div/div[1]/div/a");

            //Identify the Sign In button and click
            IWebElement signIn = driver.FindElement(By.XPath("//*[@id='home']/div/div/div[1]/div/a"));

            signIn.Click();

            //Wait for email textbox to be present
            Wait.ElementPresent(driver, "Name", "email");

            ExcelLibHelpers.PopulateInCollection(@"D:\Internship\Onboarding_task\SkillExchange\SkillExchange\TestData\TestData.xls", "LoginPage");

            //Identify the email textbox and click
            IWebElement email = driver.FindElement(By.Name("email"));

            email.SendKeys(ExcelLibHelpers.ReadData(2, "email"));


            //Identify the password textbox and click
            IWebElement pswrd = driver.FindElement(By.Name("password"));

            pswrd.SendKeys(ExcelLibHelpers.ReadData(2, "password"));


            //Identify the Login button and click
            IWebElement login = driver.FindElement(By.XPath("//html/body/div[2]/div/div/div[1]/div/div[4]/button"));

            login.Click();

            //Wait for Home page to be loaded by checking if 'Sign Out' is visible
            Wait.ElementIsVisible(driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/a[2]/button");
        }
コード例 #3
0
        public void LoginSteps()
        {
            //Wait for login page to be loaded and 'Sign In' to become visible
            Wait.ElementIsVisible(driver, "XPath", "//*[@id='home']/div/div/div[1]/div/a");

            //Click on Sign in button
            signIn.Click();

            ExcelLibHelpers.PopulateInCollection(ServiceData.ExcelPath, "SignUp");

            //Wait for email textbox to be present
            Wait.ElementPresent(driver, "Name", "email");

            //Read the emailID data from excel and enter the data into the Email Textbox
            email.SendKeys(ExcelLibHelpers.ReadData(2, "EmailID"));

            //Read the Password data from excel and enter the data into the Password Textbox
            pswrd.SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            //Click on the Login button
            login.Click();

            //Wait for Home page to be loaded by checking if 'Sign Out' is visible
            Wait.ElementIsVisible(driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/a[2]/button");
        }
        public void AvailabilityDetails()
        {
            //Populate data from Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Profile");

            #region Availability Type details entry
            //Waiting for Profile page to load after signing in
            WaitHelpers.ExplicitWait(driver, "ElementToBeClickable", "XPath", "//span[contains(text(),'Time')]/i", 10);
            // Click Edit icon
            AvailabilityTimeEdit.Click();
            // Click dropdown menu
            AvailabilityTime.Click();
            // Choose Availability parttime; fulltime
            new SelectElement(AvailabilityTime).SelectByText(ExcelLibHelpers.ReadData(3, "Column20"));
            #endregion

            #region Availability Time details entry
            //Enter Availability Hours
            AvailabilityHoursEdit.Click();
            // Click dropdown menu
            AvailabilityHours.Click();
            // Select Hours 0-less than 30h; 1-more than 30h 2-as needed
            new SelectElement(AvailabilityHours).SelectByText(ExcelLibHelpers.ReadData(3, "Column21"));
            #endregion

            #region Salary details entry
            //Enter Earn Target
            SalaryEdit.Click();
            // Click dropdown menu
            Salary.Click();
            // Click earn 0-less than 500; 1-500~1000; 2-more than 1000
            new SelectElement(Salary).SelectByText(ExcelLibHelpers.ReadData(3, "Column22"));
            #endregion
        }
コード例 #5
0
        public void AddTM(IWebDriver driver)
        {
            // identify Create New button
            driver.FindElement(By.XPath("//*[@id='container']/p/a")).Click();

            // Populate Create TM test data collection
            ExcelLibHelpers.PopulateInCollection(@"A:\TestCases\Login Page\Login Page\TestData\TestData.xls", "TMPage");
            //identify code button
            driver.FindElement(By.Id("Code")).SendKeys(ExcelLibHelpers.ReadData(2, "Code"));
            //identify description button
            driver.FindElement(By.Id("Description")).SendKeys(ExcelLibHelpers.ReadData(2, "Description"));
            //click on Save button
            driver.FindElement(By.Id("SaveButton")).Click();
            // wait
            // Thread.Sleep(1000);
            // wait for the TM page to be loaded and Go to last page button rendered
            Sync.WaitForVisiblitity(driver, "XPath", "//*[@id='tmsGrid']/div[4]/a[4]", 10);
            // go to the last page
            driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[4]/a[4]")).Click();
            // wait for the TM page to be loaded and Go to last page button rendered
            Sync.WaitForVisiblitity(driver, "XPath", ".//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[1]", 20);
            // Implementation of Assertion
            Assert.That(driver.FindElement(By.XPath(".//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[1]")).Text, Is.EqualTo(ExcelLibHelpers.ReadData(2, "Code")));

            //// verify if T&M present record is presen or not
            //if (driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[1]")).Text == "Perfect")
            //{
            //    Console.WriteLine("TM created successfully, Test Passed");
            //}
            //else
            //{
            //    Console.WriteLine("Test Failed");
            //}
        }
コード例 #6
0
        public void loginSteps(IWebDriver driver)
        {
            ExcelLibHelpers.PopulateInCollection(@"/Users/oiyo/Projects/Industryconnect/Industryconnect/TestData.xlsx", "LoginPage");

            //Enter the url
            driver.Navigate().GoToUrl("http://horse-dev.azurewebsites.net/Account/Login?ReturnUrl=%2f");

            //Locate Username textbox and enter the username
            IWebElement Username = driver.FindElement(By.Id("UserName"));

            Username.SendKeys(ExcelLibHelpers.ReadData(2, "Username"));

            //Locate Password textbox and enter the password
            IWebElement Password = driver.FindElement(By.Id("Password"));

            Password.SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            //Locate the login button and click on it
            IWebElement Login = driver.FindElement(By.XPath("//*[@id='loginForm']/form/div[3]/input[1]"));

            Login.Click();

            //Check if the home page is displayed
            IWebElement helloHari = driver.FindElement(By.XPath("//*[@id='logoutForm']/ul/li/a"));

            if (helloHari.Text == "Hello hari!")
            {
                Console.WriteLine("Logged in successfully, Test passed");
            }
            else
            {
                Console.WriteLine("Login page not seen, Test Failed");
            }
        }
コード例 #7
0
        public void VerifyEnterProfileEducation()
        {
            //Populate data saved in Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Profile");

            //Refresh the page
            driver.Navigate().Refresh();
            //Wait for all text present in Element
            WaitHelpers.WaitForTextPresentInElement(driver, profileName, ExcelLibHelpers.ReadData(3, "Column18"), 10);

            #region Verify Education
            //Jump to Education tab
            EducationTab.Click();
            //Verify Education Country
            var lastRowEducationCountry = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[4]//div[2]//tbody[last()]/tr/td[1]")).Text;
            Assert.IsTrue(lastRowEducationCountry.Contains(ExcelLibHelpers.ReadData(3, "Column7")));

            //Verify Education Name
            var lastRowEducationName = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[4]//div[2]//tbody[last()]/tr/td[2]")).Text;
            Assert.IsTrue(lastRowEducationName.Contains(ExcelLibHelpers.ReadData(3, "Column6")));

            //Verify Education Title
            var lastRowEducationTitle = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[4]//div[2]//tbody[last()]/tr/td[3]")).Text;
            Assert.IsTrue(lastRowEducationTitle.Contains(ExcelLibHelpers.ReadData(3, "Column8")));

            //Verify Education Degree
            var lastRowEducationDegree = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[4]//div[2]//tbody[last()]/tr/td[4]")).Text;
            Assert.IsTrue(lastRowEducationDegree.Contains(ExcelLibHelpers.ReadData(3, "Column9")));

            //Verify Education Graduation Year
            var lastRowEducationGraduationYear = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[4]//div[2]//tbody[last()]/tr/td[5]")).Text;
            Assert.IsTrue(lastRowEducationGraduationYear.Contains(ExcelLibHelpers.ReadData(3, "Column10")));
            #endregion
        }
コード例 #8
0
        public void EnterProfileEducation()
        {
            // Populate data from Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Profile");

            #region Enter Education
            //Click Add New
            EducationAddNewBtn.Click();
            //Enter University Name
            EducationName.SendKeys(ExcelLibHelpers.ReadData(3, "Column6"));
            //Enter Degree
            EducationDegree.SendKeys(ExcelLibHelpers.ReadData(3, "Column9"));
            //Choose Country
            EducationCountryDropdownBox.Click();
            new SelectElement(EducationCountryDropdownBox).SelectByText(ExcelLibHelpers.ReadData(3, "Column7"));
            //Choose  Title 0-Associate; 1-B.A; 2-BArch; 3-BFA; 4-B.Sc...
            EducationTitleDropdownBox.Click();
            new SelectElement(EducationTitleDropdownBox).SelectByText(ExcelLibHelpers.ReadData(3, "Column8"));
            //Choose Year
            EducationGraduationYearDropdownBox.Click();
            new SelectElement(EducationGraduationYearDropdownBox).SelectByText(ExcelLibHelpers.ReadData(3, "Column10"));
            //Click Add
            EducationAddBtn.Click();
            #endregion
        }
コード例 #9
0
        public void VerifyEnterProfileCertifications()
        {
            //Populate data saved in Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Profile");

            //Refresh the page
            driver.Navigate().Refresh();
            //Wait for all text present in Element
            WaitHelpers.WaitForTextPresentInElement(driver, profileName, ExcelLibHelpers.ReadData(3, "Column18"), 10);

            #region Verify Certifications
            //Jump to Certification tab
            CertificationTab.Click();
            //Verify Certificate Name
            var lastRowCertificateName = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[5]//div[2]//tbody[last()]/tr/td[1]")).Text;
            Assert.IsTrue(lastRowCertificateName.Contains(ExcelLibHelpers.ReadData(3, "Column12")));

            //Verify Certificate Issuing Place
            var lastRowCertificateFrom = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[5]//div[2]//tbody[last()]/tr/td[2]")).Text;
            Assert.IsTrue(lastRowCertificateFrom.Contains(ExcelLibHelpers.ReadData(3, "Column13")));

            //Verify Certificate Year
            var lastRowCertificateYear = driver.FindElement(By.XPath("//*[@id='account-profile-section']" + "/div/section[2]//div[3]/form/div[5]//div[2]//tbody[last()]/tr/td[3]")).Text;
            Assert.IsTrue(lastRowCertificateYear.Contains(ExcelLibHelpers.ReadData(3, "Column14")));
            #endregion
        }
コード例 #10
0
        public void DeleteProfile()
        {
            //Populate data from Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Profile");

            //Wait for all text present in Element
            WaitHelpers.WaitForTextPresentInElement(driver, profileName, ExcelLibHelpers.ReadData(3, "Column18"), 10);

            #region Delete Language
            //Delete the last record
            LanguageTab.Click();
            LanguageDeleteBtn.Click();
            #endregion

            #region Delete Skills
            //Delete last record
            SkillTab.Click();
            SkillDeleteBtn.Click();
            #endregion

            #region Delete Education
            //Delete last record
            EducationTab.Click();
            EducationDeleteBtn.Click();
            #endregion

            #region Delete Certification
            //Delete last record
            CertificationTab.Click();
            CertificateDeleteBtn.Click();
            #endregion
        }
コード例 #11
0
        public void LoginSteps(IWebDriver driver)
        {
            // open up chrome browser
            //IWebDriver driver = new ChromeDriver(@"D:\chrome_webdriver");

            // enter the url
            driver.Navigate().GoToUrl("http://horse-dev.azurewebsites.net/Account/Login?ReturnUrl=%2f");

            // maximize the browser
            driver.Manage().Window.Maximize();

            //Populate Loging Page test data Collection
            ExcelLibHelpers.PopulateInCollection(@"C:\Users\myfri\Source\Repos\pavulurikc\chowdary\Chowdary\TestData\TestData.xls", "LoginPage");

            // identify username and enter username value
            driver.FindElement(By.Id("UserName")).SendKeys(ExcelLibHelpers.ReadData(2, "UserName"));

            // identify password and enter password
            driver.FindElement(By.Id("Password")).SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            // identify login button and click
            driver.FindElement(By.XPath("//*[@id='loginForm']/form/div[3]/input[1]")).Click();

            // verify if the home page is displayed as expected
            if (driver.FindElement(By.XPath("//*[@id='logoutForm']/ul/li/a")).Text == "Hello hari!")
            {
                Console.WriteLine("Test Passed");
            }
            else
            {
                Console.WriteLine("Test Failed");
            }
        }
コード例 #12
0
        internal void LoginSteps(IWebDriver driver)
        {
            //After hiting URl
            //Click in SignIn button
            SignInTab.Click();

            //populate login page data collection
            ExcelLibHelpers.PopulateInCollection(MarsResource.ExcelPath, "SignIn");
            //Give Email Address
            Email.SendKeys(ExcelLibHelpers.ReadData(2, "Email"));

            //give password
            Password.SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            //check on check-box
            CheckBox.Click();

            //click on Login Button
            Login.Click();
            try
            {
                //Wait untill
                CommomDriver.WaitForVisibility(driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span", 5);
                //Assertion for checking condition
                Assert.That(LoginText.Text, Is.EqualTo(ExcelLibHelpers.ReadData(2, "Text")));
            }
            catch (NoSuchElementException e)
            {
                Console.WriteLine(e.Message);
            }
        }
コード例 #13
0
        public void AddCustome(IWebDriver driver)
        {
            // identify Create New button
            driver.FindElement(By.XPath("//*[@id='container']/p/a")).Click();
            // Populate Add Customer test data collection
            ExcelLibHelpers.PopulateInCollection(@"A:\TestCases\Login Page\Login Page\TestData\TestData.xls", "CustomerPage");
            //identify Name button
            driver.FindElement(By.XPath("//*[@id='Name']")).SendKeys(ExcelLibHelpers.ReadData(2, "Name"));
            //identify Edit Contact button
            driver.FindElement(By.XPath("//*[@id='EditContactButton']")).Click();
            //wait
            //Thread.Sleep(1000);
            // wait for the Edit Contact page to be loaded and First name, LastName textbox rendered
            Sync.WaitForVisiblitity(driver, "XPath", "//*[@id='contactDetailWindow']/iframe", 10);
            // Handle second window
            driver.SwitchTo().Frame(driver.FindElement(By.XPath("//*[@id='contactDetailWindow']/iframe")));
            // identify First Name of edit contact
            driver.FindElement(By.XPath("//*[@id='FirstName']")).SendKeys(ExcelLibHelpers.ReadData(2, "FirstName"));
            // identify Last Name botton of Edit Contact
            driver.FindElement(By.XPath("//*[@id='LastName']")).SendKeys(ExcelLibHelpers.ReadData(2, "LastName"));
            // identify the Phone botton of Edit contact
            driver.FindElement(By.XPath("//*[@id='Phone']")).SendKeys(ExcelLibHelpers.ReadData(2, "Phone"));
            //click on Save Edit contact button
            driver.FindElement(By.XPath(".//*[@id='submitButton' ][@value='Save Contact']")).Click();
            driver.SwitchTo().DefaultContent();
            // click on Save as above

            driver.FindElement(By.XPath("//*[@id='IsSameContact']")).Click();

            // Click on save button
            driver.FindElement(By.XPath(".//*[@id='submitButton' ]")).Click();
            // click on administration
            driver.FindElement(By.XPath("/html/body/div[3]/div/div/ul/li[5]/a")).Click();

            // Click on Customer
            driver.FindElement(By.XPath("/html/body/div[3]/div/div/ul/li[5]/ul/li[1]/a")).Click();
            // wait
            // Thread.Sleep(3000);
            // wait for the Customer page to be loaded and Go to Last Page button rendered
            Sync.WaitForVisiblitity(driver, "XPath", "//*[@id='clientsGrid']/div[4]/a[4]", 10);

            // go to the last page
            driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[4]/a[4]")).Click();
            // wait
            //Thread.Sleep(1000);
            // wait for the Last record of Customer page to be loaded and new record to be display
            Sync.WaitForVisiblitity(driver, "XPath", "//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[2]", 10);
            // Implementation of Assertion
            Assert.That(driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[2]")).Text, Is.EqualTo(ExcelLibHelpers.ReadData(2, "Name")));

            //// verify if Customer record is present or not
            //if (driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[2]")).Text == "Bharati")
            //{
            //    Console.WriteLine("Customer created successfully, Test Passed");
            //}
            //else
            //{
            //    Console.WriteLine("Test Failed");
            //}
        }
コード例 #14
0
        public void login()
        {
            CommonDriver.driver = new ChromeDriver();
            ExcelLibHelpers.PopulateInCollection(@"C:\Users\aadhith.bose\Dropbox\Software Testing\Industry Connect\10 AutomationTesting\2018 Aug\Demo\Demo\Data\data.xlsx", "tc1");

            LoginPage loginObj = new LoginPage();

            loginObj.LoginSteps();
        }
コード例 #15
0
        public void Setup()
        {
            driver = new ChromeDriver();
            //populate the data in excel
            ExcelLibHelpers.PopulateInCollection(@"C:\Code\ic\ic-2019-05\horsedev\Data\testdata.xlsx", "timeTestData");
            LoginPage loginPage = new LoginPage(driver);

            loginPage.LoginSuccess();
        }
コード例 #16
0
 public void SkillSearch()
 {
     SearchBox.Click();
     //Populate data from Excel and search for skill
     ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Search");
     SearchBox.SendKeys(ExcelLibHelpers.ReadData(3, "Column0") + Keys.Enter);
     //Wait for page load with search results
     WaitHelpers.ExplicitWait(driver, "ElementIsVisible", "XPath", "//*[@id='service-search-section']/div[2]/div/section/div/div[2]/div/div[1]/div", 10);
 }
コード例 #17
0
        internal void EnterValidDataandSave()
        {
            ExcelLibHelpers.PopulateInCollection(@"C:\Users\KHeartMiranda\source\repos\ConsoleApp2\ConsoleApp2\Test Data\Test.xlsx", "Data Sheet");

            //driver.FindElement(By.XPath("(//span[contains(.,'Time')])[3]"));
            driver.FindElement(By.Id("Code")).SendKeys(ExcelLibHelpers.ReadData(2, "Code"));
            driver.FindElement(By.Id("Description")).SendKeys(ExcelLibHelpers.ReadData(2, "Description"));
            driver.FindElement(By.XPath("//input[contains(@class,'k-formatted-value k-input')]")).SendKeys(ExcelLibHelpers.ReadData(2, "Price"));
            driver.FindElement(By.Id("SaveButton")).Click();
        }
コード例 #18
0
        public void ThenIShouldBeAbleToEditTimeAndMaterial()
        {
            // Time & Material Page - Click on Edit Button and Edit Time and Material Value.
            TimeandMaterialPage instanceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

            ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "EditTimeAndMaterials");
            instanceNameTandM.EditTimenMaterail();

            //Closing driver instance
            GlobalDriver.driver.Close();
        }
コード例 #19
0
ファイル: SignUp.cs プロジェクト: nishasara/CompetitionTask
        //Function to register new user
        public void Register()
        {
            ExcelLibHelpers.PopulateInCollection(ServiceData.ExcelPath, "SignUp");

            //Click Join to sign up for the skill exchange Portal
            Join.Click();

            //Enter the data for First name
            FirstName.SendKeys(ExcelLibHelpers.ReadData(2, "FirstName"));

            //Enter the data for Last name
            LastName.SendKeys(ExcelLibHelpers.ReadData(2, "LastName"));

            //Enter the data for EmailID
            Email.SendKeys(ExcelLibHelpers.ReadData(2, "EmailID"));

            //Enter the data for Password
            Password.SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            //Enter the data for Confirm Password
            CnfrmPswrd.SendKeys(ExcelLibHelpers.ReadData(2, "ConfirmPassword"));

            //Check on the terms and conditions check box prior to clicking the Join button
            TermsCndtnsChkbox.Click();

            //Click on the Join button to complete the registration
            JoinButton.Click();

            //Implicit wait for the registeration pop up to be available
            Wait.wait(2, driver);

            try
            {
                if (FirstTime)
                {
                    if (PopUp.Text == "Registration Successfull")
                    {
                        TestContext.WriteLine(PopUp.Text);
                    }
                }
                else
                {
                    String EmailValidationMsg = EmailValidation.Text;
                    if (EmailValidationMsg == "This email has already been used to register an account.")
                    {
                        TestContext.WriteLine("The account has already been created with this emailID, Please log in using exisitng account details");
                    }
                }
            }
            catch (Exception e)
            {
                Assert.Fail("Registration failed due to 1 or more errors. Make sure that there isn't an existing account", e.Message);
            }
        }
コード例 #20
0
        public void ThenIShouldBeAbleToDeleteTimeAndMaterial()
        {
            // Time & Material Page - Click on Delete and Confirm Delete Time and Material value.
            TimeandMaterialPage instanceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

            ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "DeleteTimeAndMaterials");
            instanceNameTandM.deleteTimenMaterial();

            //Closing driver instance
            GlobalDriver.driver.Close();
        }
コード例 #21
0
 public void LogInSteps()
 {
     //Populate data from Excel
     ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Login");
     //Enter Email and Password for login
     Email.SendKeys(ExcelLibHelpers.ReadData(3, "Column0"));
     Password.SendKeys(ExcelLibHelpers.ReadData(3, "Column1"));
     //Click on login button
     LoginButton.Click();
     //Wait for the Profile page to load after login
     WaitHelpers.ExplicitWait(driver, "ElementExists", "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span", 10);
 }
コード例 #22
0
        internal void editTM(IWebDriver driver)
        {
            ExcelLibHelpers.PopulateInCollection(@"/Users/oiyo/Projects/Industryconnect/Industryconnect/TestData.xlsx", "TimeAndMaterialPage");

            //Navigate to Time and Material page
            IWebElement administration = driver.FindElement(By.XPath("/html/body/div[3]/div/div/ul/li[5]/a"));

            administration.Click();

            //Click on Time and management
            IWebElement timeAndManagement = driver.FindElement(By.XPath("/html/body/div[3]/div/div/ul/li[5]/ul/li[3]"));

            timeAndManagement.Click();
            Thread.Sleep(1000);

            //edit the first row of Time and Material
            IWebElement edit = driver.FindElement(By.XPath("//*[@id=\"tmsGrid\"]/div[3]/table/tbody/tr[1]/td[5]/a[1]"));

            edit.Click();

            //change the code
            IWebElement Code = driver.FindElement(By.Id("Code"));

            Code.Click();
            Code.Clear();
            Code.SendKeys(ExcelLibHelpers.ReadData(3, "Code"));

            //change the price
            IWebElement Price = driver.FindElement(By.XPath("//*[@id=\"TimeMaterialEditForm\"]/div/div[4]/div/span[1]/span/input[1]"));

            Price.Click();
            IWebElement PriceInput2 = driver.FindElement(By.XPath("//*[@id=\"TimeMaterialEditForm\"]/div/div[4]/div/span[1]/span/input[2]"));

            PriceInput2.Clear();
            Price.SendKeys(ExcelLibHelpers.ReadData(3, "Price"));


            //Price.Click();
            //Thread.Sleep(2000);
            //Price.SendKeys(ExcelLibHelpers.ReadData(3, "Price"));

            //change the description
            IWebElement Description = driver.FindElement(By.XPath("//*[@id=\"Description\"]"));

            Description.Click();
            Description.Clear();
            Description.SendKeys(ExcelLibHelpers.ReadData(3, "Description"));

            //Click on save button
            IWebElement save1 = driver.FindElement(By.XPath("//*[@id=\"SaveButton\"]"));

            save1.Click();
        }
コード例 #23
0
        public void ThenIShouldBeAbleToCreateTimeAndMaterial()
        {
            TimeandMaterialPage inssatnceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

            inssatnceNameTandM.Clickcreate();
            //inssatnceNameTandM.Savebutton1();
            ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "CreateTimeAndMaterials");
            inssatnceNameTandM.CreateTimeAndMaterial();
            //GlobalDriver.driver.Dispose();
            //Closing driver instance
            GlobalDriver.driver.Close();
        }
コード例 #24
0
 public void FailedRegistration()
 {
     //Populate data from Excel
     ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "Registration");
     //Enter details for new user registration
     FirstName.SendKeys(ExcelLibHelpers.ReadData(4, "Column0"));
     LastName.SendKeys(ExcelLibHelpers.ReadData(4, "Column1"));
     EmailAddress.SendKeys(ExcelLibHelpers.ReadData(4, "Column2"));
     Password.SendKeys(ExcelLibHelpers.ReadData(4, "Column3"));
     ConfirmPassword.SendKeys(ExcelLibHelpers.ReadData(4, "Column4"));
     TermsAndConditions.Click();
     JoinButton.Click();
 }
コード例 #25
0
ファイル: Program.cs プロジェクト: JigneshPatel1987/OctDemo
            public void edittest()
            {
                // Home Page - clicking on adminsitration and time n materials
                HomePage instanceName = new HomePage(GlobalDriver.driver);

                instanceName.clickAdminstration();
                instanceName.clickTimenMaterial();

                // Time & Material Page - Click on Edit Button and Edit Time and Material Value.
                TimeandMaterialPage instanceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

                ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "EditTimeAndMaterials");
                instanceNameTandM.EditTimenMaterail();
            }
コード例 #26
0
ファイル: Program.cs プロジェクト: JigneshPatel1987/OctDemo
            public void deletetest()
            {
                // Home Page - clicking on adminsitration and time n materials
                HomePage instanceName = new HomePage(GlobalDriver.driver);

                instanceName.clickAdminstration();
                instanceName.clickTimenMaterial();

                // Time & Material Page - Click on Delete and Confirm Delete Time and Material value.
                TimeandMaterialPage instanceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

                ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "DeleteTimeAndMaterials");
                instanceNameTandM.deleteTimenMaterial();
            }
コード例 #27
0
        public void PasswordChangewithSamePassword()
        {
            //Populate data from Excel
            ExcelLibHelpers.PopulateInCollection(Paths.ExcelPath, "ChangePassword");

            CurrentPass = (ExcelLibHelpers.ReadData(3, "Column0"));
            NewPass     = (ExcelLibHelpers.ReadData(3, "Column1"));

            //Enter Current, new and confirm password
            CurrentPassword.SendKeys(ExcelLibHelpers.ReadData(3, "Column0"));
            NewPassword.SendKeys(ExcelLibHelpers.ReadData(3, "Column1"));
            ConfirmPassword.SendKeys(ExcelLibHelpers.ReadData(3, "Column2"));
            SaveButton.Click();
        }
コード例 #28
0
        public void GivenNavigateToTimeAndMaterialRecordPage()
        {
            //Creating instance of chrome driver
            GlobalDriver.driver = new ChromeDriver();

            // IWebDriver driver = new ChromeDriver();
            GlobalDriver.driver.Navigate().GoToUrl("http://horse-dev.azurewebsites.net/Account/Login");
            ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "Login");

            // login page :: Identifying and sending valid inputs
            LoginPage loginPage = new LoginPage(GlobalDriver.driver);

            loginPage.LoginSuccess();
        }
コード例 #29
0
 public void EditCustomer(IWebDriver driver)
 {
     // wait
     Thread.Sleep(2000);
     // click on Edit button
     driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[last()]/a[1]")).Click();
     // Handle second window
     driver.SwitchTo().Frame(driver.FindElement(By.XPath("//*[@id='detailWindow']/iframe")));
     // Populate Edit Customer test data collection
     ExcelLibHelpers.PopulateInCollection(@"A:\TestCases\Login Page\Login Page\TestData\TestData.xls", "CustomerPage");
     // remove record from Name button
     driver.FindElement(By.XPath("//*[@id='Name']")).Clear();
     // Fill the value in code button
     driver.FindElement(By.XPath("//*[@id='Name']")).SendKeys(ExcelLibHelpers.ReadData(3, "Name"));
     // Click on Edit Contact
     driver.FindElement(By.XPath("//*[@id='EditContactButton']")).Click();
     Thread.Sleep(1000);
     // Handle third window
     driver.SwitchTo().Frame(driver.FindElement(By.XPath("//*[@id='contactDetailWindow']/iframe")));
     // identify First Name button of Edit Contact
     driver.FindElement(By.XPath("//*[@id='FirstName']")).SendKeys(ExcelLibHelpers.ReadData(3, "FirstName"));
     // identify Last Name botton of Edit Contact
     driver.FindElement(By.XPath("//*[@id='LastName']")).SendKeys(ExcelLibHelpers.ReadData(3, "LastName"));
     // identify the Phone botton of Edit contact
     driver.FindElement(By.XPath("//*[@id='Phone']")).SendKeys(ExcelLibHelpers.ReadData(3, "Phone"));
     // CLICK on SaveContact button
     driver.FindElement(By.XPath("//*[@id='submitButton'][@value='Save Contact']")).Click();
     // back to second window
     driver.SwitchTo().DefaultContent();
     //wait
     Thread.Sleep(1000);
     // Handle second window
     driver.SwitchTo().Frame(driver.FindElement(By.XPath("//*[@id='detailWindow']/iframe")));
     // click on save button
     driver.FindElement(By.XPath("//*[@id='submitButton'][@value='Save']")).Click();
     // wait
     Thread.Sleep(1000);
     // Implementation of Assertion
     Assert.That(driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[2]")).Text, Is.EqualTo(ExcelLibHelpers.ReadData(3, "Name")));
     //// verify if Customer editing function work or not
     //if (driver.FindElement(By.XPath("//*[@id='clientsGrid']/div[2]/table/tbody/tr[last()]/td[2]")).Text == "Industry")
     //{
     //    Console.WriteLine("Customer edited successfully, Test Passed");
     //}
     //else
     //{
     //    Console.WriteLine("Test Failed");
     //}
 }
コード例 #30
0
ファイル: Program.cs プロジェクト: JigneshPatel1987/OctDemo
            public void CreateTest()
            {
                // Home Page - clicking on adminsitration and time n materials
                HomePage instanceName = new HomePage(GlobalDriver.driver);

                instanceName.clickAdminstration();
                instanceName.clickTimenMaterial();

                TimeandMaterialPage inssatnceNameTandM = new TimeandMaterialPage(GlobalDriver.driver);

                inssatnceNameTandM.Clickcreate();
                //inssatnceNameTandM.Savebutton1();
                ExcelLibHelpers.PopulateInCollection(@"E:\TestData\TestDataForHorseDev.xlsx", "CreateTimeAndMaterials");
                inssatnceNameTandM.CreateTimeAndMaterial();
            }