Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. WebDriver driver1;
  2. WebDriverWait wait = new WebDriverWait(driver1,20);
  3. By SysopUserName = By.id("ctl00_ContentPlaceBody_Login1_UserName");
  4. By SysopPassword = By.id("ctl00_ContentPlaceBody_Login1_Password");
  5. By AdminLoginButton = By.id("ctl00_ContentPlaceBody_Login1_ButtonSubmit");
  6. By JobManagementandMonitoringlink = By.linkText("Job Management and Monitoring");
  7. By RunJobbutton = By.id("ctl00_ContentPlaceBody_GridViewJobs_ctl09_btnRun");
  8. WebElement RunJobBut;
  9.  
  10. //Constructor
  11. public SFQA_Administrator(WebDriver driver)
  12. {
  13. this.driver1=driver;
  14. }
  15.  
  16. public void Startup()
  17. {
  18. driver1.manage().window().maximize();
  19.  
  20. }
  21.  
  22. public void LogintoAdministrator(String Uname, String Pass)
  23. {
  24. driver1.findElement(SysopUserName).sendKeys(Uname);
  25. driver1.findElement(SysopPassword).sendKeys(Pass);
  26. driver1.findElement(AdminLoginButton).click();
  27. }
  28.  
  29.  
  30. public void JobListPage() {
  31. // TODO Auto-generated method stub
  32. driver1.findElement(JobManagementandMonitoringlink).click();
  33. Assert.assertTrue(driver1.getPageSource().contains("Job list"));
  34. }
  35.  
  36. public void runjob()
  37. {
  38. if(driver1.findElement(RunJobbutton).isDisplayed())
  39. {
  40. RunJobBut.click();
  41. Assert.assertFalse(driver1.findElement(RunJobbutton).isDisplayed(), "The Run Job Button is Hidden in IF Loop");
  42. }
  43. else
  44. {
  45. wait.until(ExpectedConditions.visibilityOfElementLocated(RunJobbutton));
  46. RunJobBut.click();
  47. Assert.assertFalse(driver1.findElement(RunJobbutton).isDisplayed(), "The Run Job Button is Hidden in Else Loop");
  48. }
  49.  
  50.  
  51.  
  52.  
  53. }
  54.  
  55. WebDriver driver = new FirefoxDriver();
  56. SFQA_Administrator logon = new SFQA_Administrator(driver);
  57. By RunJobbutton = By.id("ctl00_ContentPlaceBody_GridViewJobs_ctl09_btnRun");
  58.  
  59. @Test
  60.  
  61. @Test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement