Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebDriver driver1;
- WebDriverWait wait = new WebDriverWait(driver1,20);
- By SysopUserName = By.id("ctl00_ContentPlaceBody_Login1_UserName");
- By SysopPassword = By.id("ctl00_ContentPlaceBody_Login1_Password");
- By AdminLoginButton = By.id("ctl00_ContentPlaceBody_Login1_ButtonSubmit");
- By JobManagementandMonitoringlink = By.linkText("Job Management and Monitoring");
- By RunJobbutton = By.id("ctl00_ContentPlaceBody_GridViewJobs_ctl09_btnRun");
- WebElement RunJobBut;
- //Constructor
- public SFQA_Administrator(WebDriver driver)
- {
- this.driver1=driver;
- }
- public void Startup()
- {
- driver1.manage().window().maximize();
- }
- public void LogintoAdministrator(String Uname, String Pass)
- {
- driver1.findElement(SysopUserName).sendKeys(Uname);
- driver1.findElement(SysopPassword).sendKeys(Pass);
- driver1.findElement(AdminLoginButton).click();
- }
- public void JobListPage() {
- // TODO Auto-generated method stub
- driver1.findElement(JobManagementandMonitoringlink).click();
- Assert.assertTrue(driver1.getPageSource().contains("Job list"));
- }
- public void runjob()
- {
- if(driver1.findElement(RunJobbutton).isDisplayed())
- {
- RunJobBut.click();
- Assert.assertFalse(driver1.findElement(RunJobbutton).isDisplayed(), "The Run Job Button is Hidden in IF Loop");
- }
- else
- {
- wait.until(ExpectedConditions.visibilityOfElementLocated(RunJobbutton));
- RunJobBut.click();
- Assert.assertFalse(driver1.findElement(RunJobbutton).isDisplayed(), "The Run Job Button is Hidden in Else Loop");
- }
- }
- WebDriver driver = new FirefoxDriver();
- SFQA_Administrator logon = new SFQA_Administrator(driver);
- By RunJobbutton = By.id("ctl00_ContentPlaceBody_GridViewJobs_ctl09_btnRun");
- @Test
- @Test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement