Beispiel #1
0
        public void SampleOrders_r2()
        {
            //launch browser
            OpenBrowser();

            //add data to exceldata file
            //  ExcelDataUtility.PopulateInCollection(ConfigurationManager.AppSettings["ProjectPath"] + "\\Resources\\SampleOrderInput2.xlsx", 1);

            try
            {
                //initialize test report

                commonFunctionsUtilities = new CommonFunctionsUtility_StressTests(driver);

                //login
                commonFunctionsUtilities.Login();

                System.Threading.Thread.Sleep(4000);
                commonFunctionsUtilities.Click("ctrlHeader2018_ctl00_link1Url");
                commonFunctionsUtilities.Click("cphContent_cphContentMain_ctl00_ctl02_rptSamplePreshopItems_samplePreshopMidItem_0");

                //select a sample to add in basket
                commonFunctionsUtilities.CheckIfLoadedXpath("//ul[@id='ProductListerTop34']");
                IList <IWebElement> list = driver.FindElements(By.XPath("//ul[@id='ProductListerTop34']/li"));
                list[0].Click();
                list[1].Click();

                commonFunctionsUtilities.Click("cphContent_cphContentMain_ctl00_ctl01_rptGroupListAndValues_btnNextTop_0");

                //fill in input
                System.Threading.Thread.Sleep(5000);
                //  commonFunctionsUtilities.AddInputFromDataTable();
                commonFunctionsUtilities.AddInput("fc_nameSC", "firstname");
                commonFunctionsUtilities.AddInput("fc_lastnameSC", "lastname");
                commonFunctionsUtilities.AddInput("fc_emailSC", "*****@*****.**");
                commonFunctionsUtilities.AddInput("fc_zipSC", "9001AS");
                commonFunctionsUtilities.AddInput("fc_housenumberSC", "20");
                commonFunctionsUtilities.AddInput("fc_streetSC", "street name");
                commonFunctionsUtilities.AddInput("fc_citySC", "city name");


                commonFunctionsUtilities.Click("ctl16_fieldsetDelivery");

                driver.FindElement(By.XPath("//a[@onclick='ValidateFields(true); return false;']")).Click();
                System.Threading.Thread.Sleep(1000);
                driver.FindElement(By.XPath("//a[@onclick='ResetHF();' and @id='ctl16_homeLink']")).Click();
                System.Threading.Thread.Sleep(1000);

                driver.Quit();
            }
            catch (Exception e)
            {
                throw;
            }
            finally
            {
                CloseBrowser();
            }
        }
        public void AdvisorRequest()
        {
            OpenBrowser();


            try
            {
                //initialize test report

                commonFunctionsUtilities = new CommonFunctionsUtility_StressTests(driver);

                //login
                commonFunctionsUtilities.Login();

                //go to advisor request
                driver.Url = ConfigurationManager.AppSettings["Url"] + "tips-tricks/afspraak-maken-raamdecoratie/nl/page/149/";

                //fill in input

                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_rptSubjectFields_txtVoornaam_0", "firstname");
                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_rptSubjectFields_txtAchternaam_1", "lastname");
                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_rptSubjectFields_txtTelefoonnummer_2", "0632252512");
                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_rptSubjectFields_txtPostcode_3", "9001AS");
                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_rptSubjectFields_txtHuisnummer_4", "20");
                commonFunctionsUtilities.AddInput("cphContent_cphContentMain_ctl00_ctl00_txtEmailAddress", "*****@*****.**");

                commonFunctionsUtilities.Click("calL_2-2");


                commonFunctionsUtilities.Click("cphContent_cphContentMain_ctl00_ctl00_btnSend");

                //go to thank you page
                IWebElement thankYou = driver.FindElement(By.ClassName("adviesThankYouWrapper"));
                System.Threading.Thread.Sleep(4000);

                CloseBrowser();
            }


            catch (Exception e)
            {
                throw;
            }

            finally
            {
                CloseBrowser();
            }
        }