Tuesday

Tips for faster test automation - Selenium


Here is an excellent article on how we can have efficient test scripts in the selenium world


  1. Use few and fast locators
  2. Use only Explicit waits
  3. Write good atomic tests
  4. Use the Chrome Driver
  5. Use Headless browser drivers
  6. Re-use the browser instance
  7. Run scripts in parallel
  8. Use HTTP-parse libraries like JSoup
  9. Pre-populate cookies
  10. Do not load images
Read the entire article here:

Source: http://www.beacon.by/test-automation-for-manual-testers/10-tips-for-faster-selenium-scripts#/4

Thursday

Java Build Tools + Dependency Management for Test Automation


Build Tools - History: 
  • Save developers some time typing commands that would have many source code modules compiled and linked in a particular order. 
  • First build tool was Make a scripting language that allowed a build script to be written as a series of compile-and-link steps
  • GNU version of Make offered additional features, such as dependency management and incremental building


Java now has Maven, Gradle, Ant and some others (like Scala’s Simple Build Tool–SBT)

Ant
Ant was the first of the so-called “modern build tools”, and is used for automating build process. In theory, it is kind of like Make, without Make’s wrinkles. It is implemented in Java and used mostly for Java projects. The first public release of Ant was in 2000, and it quickly became most popular build tool for Java projects thanks to being platform independent (like Java), having low barriers for getting set up, and providing repeatable builds. Later, it also gained the ability to accept plugins.
However, Ant was criticized for having some drawbacks. Build scripts are written in XML, which is hierarchical by nature and not suitable for procedural programming, something often needed in build scripts. Ant is often claimed to be overly verbose, which means it can eventually make build scripts for large projects unmanageably big.

Maven

Maven was first released in 2004 and designed to improve upon some of the issues developers had with Ant and other build tools at the time. Maven’s biggest achievements are considered to be the introduction of project structure conventions, dependency management and a central artifact repository, Maven Central.
Maven still uses XML for writing a build file (pom.xml), but the structure is very different because it became declarative. Now developers don’t have to write down all the commands that lead to some goals, but instead he describes the structure of the project (if it differentiates from the conventions) and Maven itself provides the available targets that a programmer can invoke. Plus, Maven is capable of downloading dependencies through a network.

Gradle

Gradle is the youngest build tool of the three and its developers tried to combine Ant’s power and flexibility with Maven’s dependency management and conventions to create nice and shiny build tool. After several years of developers, Gradle v1.0 was released in 2012, and has quickly started to gain popularity. It’s developing really fast and already adopted by some big enterprises–Gradle, for example, was selected to be the build tool for Google’s Android OS.
One interesting point is that with Gradle, XML is not used anymore–instead, developers have a Domain Specific Language (DSL) based on the JVM language Groovy, which was invented so that developers could ditch the verbosity of XML and write more simple and clear statements. This has sparked a debate among users as to whether the standard, easily-understandable (but long-winded) style of XML is better or worse than DSL.

Here is a good insights into the Java build tools:






Wednesday

Java tools and technologies - Automation

Zeroturnaround does a survey on Java development and research. Here are some top technologies and how they influence the automation space as well:







Here is a complete slide deck of their research:




Source: http://zeroturnaround.com/rebellabs/java-tools-and-technologies-landscape-for-2014/



Tuesday

Repost: The Challenges of Testing the Internet of Things: STARWEST 2015 Interview with Paul Gerrard [interview]


A good one to watch:




Source: http://www.stickyminds.com/interview/challenges-testing-internet-things-starwest-2015-interview-paul-gerrard

Thursday

Migration from jUnit to TestNG



If we choose to make TestNG as the testing library in our automation framework , we can easily do that with the Eclipse/IntelliJ Plugins:


Excellent report on converting an entire project from jUnit to TestNG https://developers.opengamma.com/blog/2011/04/04/converting-opengamma-junit-testng


Use caseJUnit 4TestNGComment
Method is a test@Test@TestSimply change the import
Class is a testN/A@TestWe decided to stick with
per method annotations
in the end
Test is disabled@Ignore@Test(enabled=false)@Ignore on the class
disables all tests
 in the class, whereas @Test
(enabled = false) on the class
doesn't override @Test
on a method
An exception is expected@Test
(expected
=IOException.class)
@Test
(expectedExceptions
=IOException.class)
Simple spelling change
Test timeout@Test(timeout
=20000)
@Test(timeOut=20000)Simple spelling change
Run before/after each test method@Before/@After@BeforeMethod/
@AfterMethod
Clearer annotation name
Run before/after each test method@BeforeClass
/@AfterClass
@BeforeClass
/@AfterClass
JUnit requires a static method,
TestNG allows either a static
or an instance method
Run before/after
each entire test suite
N/A@BeforeSuite/
@AfterSuite

The problem with Automation Testers is...



Every automation tester should read this:
https://www.linkedin.com/pulse/problem-automation-testers-steve-walton?trk=hp-feed-article-title-like

Source: Steve Walton