Showing posts with label selenium. Show all posts
Showing posts with label selenium. Show all posts

Wednesday, May 12, 2021

Project Support and Online Tutor available - Test Automation, Selenium, Cucumber. TestNG, Java

Project Support and Online Tutor available - Test Automation, Selenium, Cucumber. TestNG, Java

Working professional who required training on Testing process, Test Management, Automation task support (using Selenium, TestComplete, Cucumber, TestNG), API Testing, Web Services Testing(WSDL), Non-Functional testing process, Load testing using Flood.io and JMeter, Performance Testing (JMeter), Regression Automation suite preparation, UIT Testing, Form Testing, Shopping cart testing, Payment gateway testing and etc.,

 Please contact: https://www.teacheron.com/tutor-profile/2Kiy

Tuesday, October 18, 2016

Sample Selenium test for JIRA

Selenium Basic code for login in to JIRA


Below code will be login to our JIRA System and validate the Title of the User logged in Page

==============================================
package JIRALogin;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterTest;

public class JIRALoginLogout
{
WebDriver driver;
@Test
public void LoginToJira(String username, String password ) throws InterruptedException
{
driver=new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://ABCD.COM"); // >> replace the actual JIRA URL

driver.findElement(By.id("login-form-username")).sendKeys(username);
driver.findElement(By.id("login-form-password")).sendKeys(password);
driver.findElement(By.xpath(".//*[@id='login']")).click();

Thread.sleep(5000);


Assert.assertTrue(driver.getTitle().contains("Resource"),"User naot able to Login to JIRA system");

System.out.println("User can able to Login Successfully in to JIRA System");
}

@AfterTest
public void tearDown()
{
driver.quit();
}
public Object[][] passData()
{
Object[][] data=new Object[3][2];

data[0][0]="abcd"; //>> Replace with actual Username
data[0][1]="xxxx"; // >> Replace with actual password
return data;
}
}