Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestMethod]
- public void Create_Job()
- {
- string jobDate = DateTime.Now.ToShortDateString();// "13/05/2016";
- string userName = "Paul Bicker";
- //string userName = "Wayne Barclay";
- string formKey = "PPP";
- const string LoginUsername = "admin";
- LoginUser(LoginUsername);
- const string LoginPassword = "rhi786";
- LoginPass(LoginPassword);
- _driver.FindElement(By.Id("LiJobs")).Click();
- string H1Xpath = "//div[contains(@id, 'ctl00_MainContent_RadAjaxPanel1')]/h1";
- IWebElement H1Tag = _driver.FindElement(By.XPath(H1Xpath));
- string H1Text = H1Tag.Text;
- for (int i = 0; i < 50; i++)
- {
- _driver.FindElement(By.Id("ctl00_MainContent_btnAddJob_input")).Click();
- _driver.FindElement(By.Id("ctl00_MainContent_cmbCompanies_Arrow")).Click();
- _driver.FindElement(By.Id("ctl00_MainContent_cmbCompanies_Input")).SendKeys("Nine" + Keys.Enter);
- WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(20));
- Thread.Sleep(1000);
- _driver.FindElement(By.Id("ctl00_MainContent_cmbSite_Input")).SendKeys("Nine" + Keys.Enter);
- Thread.Sleep(1000);
- IWebElement CustomerRef = _driver.FindElement(By.Id("MainContent_txtcustomerRef"));
- CustomerRef.SendKeys("123456");
- _driver.FindElement(By.Id("ctl00_MainContent_rdpJobDate_dateInput")).SendKeys(jobDate);
- _driver.FindElement(By.Id("ctl00_MainContent_lstUser_Input")).SendKeys(userName + Keys.Enter);
- IWebElement JobDesc = _driver.FindElement(By.Id("MainContent_txtJobDescription"));
- JobDesc.SendKeys("Test");
- IWebElement Notes = _driver.FindElement(By.Id("MainContent_txtNotes"));
- Notes.SendKeys("123456");
- _driver.FindElement(By.Id("ctl00_MainContent_cmbTasks_Input")).SendKeys(formKey + Keys.Enter);
- Thread.Sleep(1000);
- _driver.FindElement(By.Id("ctl00_MainContent_cmbAsset_Input")).SendKeys("S" + Keys.Enter);
- Thread.Sleep(1000);
- _driver.FindElement(By.Id("ctl00_MainContent_btnSave_input")).Click();
- Thread.Sleep(2000);
- _driver.FindElement(By.ClassName("rwInnerSpan")).Click();
- Thread.Sleep(2000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement