Thursday 21 December 2017

Connect Jira from Java using Jira REST API


Jira is one of the popular bug tracking tool developed by Atlassian. It also provides project management features inline with Agile methodology. Jira is basically written in Java & can integrate with source control programs like Perforce, Git, Clearcase, Subversion, TFS etc.
It also provides robust set of APIs which enables its integration with any system.

An interesting fact about its name 'JIRA': It is not an acronym, but a truncation of 'Gojira', the japanese name for 'Godzilla'.  :)

Example to Create Issue & Search Issue:

This example shows how to consume Jira REST APIs from Java using REST Assured libraries.

Step 1: Create a Project with dependent REST assured libraries.

NOTE: For the set up / usage of REST assured libraries can be found in another post.
https://advancedtestautomation.blogspot.in/2016/08/test-rest-web-services-using-rest.html

Thursday 7 December 2017

Selenium Tips and Tricks


Get the DOM Object into View:


At times, few actions are not performed on a DOM object until it is visible in the view-port. Below is the small code snippet to get the DOM object into view using WebDriver's 'JavascriptExecutor' interface. 

WebElement element = driver.findElement(By.id("someId"));
JavascriptExecutor js= (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView(true);",element);

OR

((JavascriptExecutor) driver).executeScript("document.getElementById('text123').scrollIntoView(true);");

Selenium WebDriver Wait Commands:

For any automation scripts to work without any sync issues with application, wait statements are very important. Selenium WebDriver provide different types of Wait conditions to make automation scripts effective.

Below are different types of waits & its usage.