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.

Thursday 28 September 2017

Validate Website Performance using Google PageSpeed Insights

Google has developed a set of website Performance Optimization tools called 'Google PageSpeed'. It has 4 main components: PageSpeed Module, PageSpeed Insights, PageSpeed Service and PageSpeed Chrome Extension. These tools are built to idetify the flaws in website’s compliance with Google’s Web Performance Best Practices.Also, automate the flaw correction process.

PageSpeed Insights:


An online tool helps in identifying performance score on any website and provides suggestions on optimizations to make website faster. This can be accessed directly in any browser. It provides the webpage performance score on a scale from 0 to 100 for each url request, provides a report on suggested optimizations. It provides specific score for mobile & desktop & corresponding suggestions.

The scores fall under the below 3 categories:
Good: The page applies most performance best practices and should deliver a good user experience.

Needs Work: The page is missing some common performance optimizations that may result in a slow user experience.

Poor: The page is not optimized and is likely to deliver a slow user experience. Please prioritize and apply the recommendations below.

Monday 17 July 2017

Integration of Selenium + Sikuli

Sikuli is a tool using Visual Recognition capability which automates anything seen on the screen of your computer running Windows, Mac, few Linux/Unix OS systems. It uses Image recognition powered by OpenCV to identify the GUI components.

The version of Sikuli is named as 'SikuliX'. It also comes with basic text recognition (OCR) feature to search text within images.Besides locating images on screen, it can handle mouse & keyboard events to interact with GUI elements. 

Friday 19 May 2017

Selenium for Angular JS Pages


Selenium + NgWebDriver  =  Better AngularJS Support

Angular JS is a opensource web application framework based on Java-script. Any Angular JS implemented web page would have additional custom tag attributs like ng-app, ng-model, ng-bind, ng-repeat etc.

Automating the AngularJS based web application is possible using Selenium. However in certain cases where the web pages are built extensively using AngularJS  resulting in complex DOM structure, it is difficult to locate DOM elements with simple XPaths & CSS selectors.In this case, Protractor (an E2E test framework for Angular Applications) built on Java script version of Selenium makes it easy for identifying the locators easily.

Sunday 19 March 2017

Voice Driven Testing using Perfecto Mobile

Most of the applications today started supporting voice commands either it is a desktop or a mobile.More & more functionalities are being supported by voice commands.

Testing these functionalities is very difficult as it requires audio files which are hard to edit / maintain them whenever required. Perfecto has come up with a better way to test these functionalities.

Steps to test Voice Driven Functionalities:
  1. Enter required text
  2. Convert Text to Audio
  3. Inject the generated Audio to application

Wednesday 25 January 2017

Seamless Integration of Selenium + AutoIT

AutoIT is a freeware available to automate Windows GUI by simulating the combinations of mouse movements & key strokes. AutoIT has its own basic syntax, editor & control identification mechanism. However, to achieve the code level integration one can use 'AutoItX', packaged with AutoIT. This supports access to AutoIT functions using COM objects.

Monday 16 January 2017

Extract Text & Images from PDF


Extracting text from PDF is not as simple as reading text from a text(.txt) file. One has to use suitable libraries to extract data from any pdf file. For example, Below code snippet shows one of the way to extract text or images from PDF file using Apache's PDFBox libraries.