Selenium with Spring boot and Gradle

Selenium is one of the leading test automation tool in software testing industry. Plenty of web applications were automated with the help of Selenium tool. As we all know, Normally selenium triggered via testNG framework and integrated with any CI tools like Jenkins.  Today testodev, talking a various approach. How selenium can run like an API ?, this can be achieved by Spring boot and Gradle. Spring boot is a development framework based on Java. Gradle is an open-source build automation tool.

This is architecture of Selenium with Spring boot and Gradle

You can clone the code available in testodev git repository

How it works 
Controller class is responsible for handling the API requests, In the sample code you can see two test were configured with request mapping annotation are,
@RequestMapping("/google")
@RequestMapping("/testodev")
When you call the test with defined annotation then its corresponding test will get triggered. For example trigger a request with /google then you can see chrome driver launches google home page.

Share your feedback, questions or suggestions via hello@testodev.com

HTTP to HTTPS Migration - A Testing perspective

HTTPS  is being used for communicating over a secure channel, The main features of HTTPS are Authentication, Encryption and Data Integrity. HTTPS Everywhere campaign has motivated the companies to make the data communication over secure channel. Google has decided to downgrade the rank of non-secure channels, this must be the other side of the motivation. Here we're discussing about the testing perspectives when your web application migrating to HTTPS.

secure-https-migration

The below 10 points you can considered as checklist for a HTTPS migration project. Here we go

1. Make sure that your web application functionality is working as expected

2. Ensure that all links are migrated to HTTPS

3. Make sure that there are no mixed content errors

4. Make sure that your SEO check list is successfully executed, which includes following items
       > Canonical, Alternative and Hreflangs langs
       > Updated Sitemap files
       > 301 redirects
       > Updated robots.txt
       > GA admin settings

5. Make sure that all e-mail signatures are updated to HTTPS

6. Make sure that all blog links are updated to HTTPS

7. Compare the page load speed with referenced values. List of tools are available here

8. Confirm that all 3rd party integration tools are updated

9. Ensure sure that all APIs and Web services are updated

10. Make sure that your CDN files are updated properly

Happy Migration..... 

Site speed tools

You need to consider all the aspects before releasing your website into production. Site speed is one of the critical factor. Sometimes we don’t always want to set up a whole performance testing suite but we need to know a rough idea about site speed of our application. Today we're discussing about the tools which help to give an idea about site speed.

1. Chrome Browser - Developer Tool
Chrome browser developer tools provides built in feature to know the site speed. Using "Audit" we can measure all of aspects of a websites like Performance, SEO, Accessibility etc

> As a first step take developer tool by pressing F12 and launch your website on same tab.
> Take Audit tab, then select "Performance" radio button and click "Run audits" button.

After measurement, the same tab displays the performance values with steps to be taken to improve the performance.  Here shows the results of testodev
site-speed-measurements


2. WEBPAGETEST - https://www.webpagetest.org/
Free website speed test from multiple locations around the globe using real browsers (IE and Chrome) and at real consumer connection speeds.Your results will provide rich diagnostic information including resource loading waterfall charts, Page Speed optimization checks and suggestions for improvements.

3. PageSpeed Insights from Google - 
PageSpeed Insights reports on the real-world performance of a page for mobile and desktop devices and provides suggestions on how that page may be improved. There are two scores are avilable in theire report, First one is Speed Score, Which gives an idea about site speed. Its values are Fast, Average and Slow Second score is Optimization Score, it measures the best practices and computes a score from 0-100. You need to achive more 80 to get the green signal. Page stats gives an idea about render-blocking resources. Finally it comes with Optimization suggestions. Here comes the values of testodev

sitespeed-insights-testodev



How to Take Screenshot in Selenium WebDriver

Screenshots are essential for bug analysis, During automation results analysis it would be highly helpful. Here we're explaining how to take screenshots using Selenium Webdriver.

TakesScreenshot is a builtin method avilable in Selenium, which helps to take screenshots. When we invoke TakesScreenshot method, then it will convert Webdriver into screenshot.

getScreenshotAs method deals with creation of image file. There are different ways of capturing the image file like Entire page, Current Window, Visible portion etc.

For more details follow this link

Here comes the code for taking screenshot of browser window
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class MyClass {
 
 public static String driverPath = "D:/Technical/chromedriver_win32/";
 public static WebDriver driver;
  
 public static void main(String []args) throws Exception {
    System.out.println("launching chrome browser");
    System.setProperty("webdriver.chrome.driver", driverPath+"chromedriver.exe");
    driver = new ChromeDriver();
    driver.navigate().to("http://google.com");
   
    GetScreenShot(driver,"D://test.png"); }

  
  public static void GetScreenShot(WebDriver webdriver, String fileWithPath)throws Exception {
  
    TakesScreenshot scrShot =((TakesScreenshot)webdriver);
    File SrcFile=scrShot.getScreenshotAs(OutputType.FILE);
    File DestFile=new File(fileWithPath);
    FileUtils.copyFile(SrcFile, DestFile);}
}

Learn JMeter for free - step by step tutorial for beginners

This is testodev first tutorial. We've selected one of the leading tool in testing field, JMeter. JMeter is a popular open source performance and load testing tool. We've designed the tutorial in simple way and especially for beginners. This package contains 7 steps and try to complete it in a series manner. let us know your valuable feedback as comments.

Step 1 - JMeter installation

Step 2 - Build first test plan

Step 3 - Running first test

Step 4Parameterization

Step 5 - Analysis of performance report

Step 6 - Assertions in JMeter

Step 7 - Best practices in JMeter