Tuesday 10 February 2015

Programming knowledge?! Yes it is becoming vital for testers

There are many instances where you can find testers saying this, "I do not have programming skills, so took up testing". And there are people who took software testing by choice, I'm proud that I belong to the later.

Well coming to the point, when testers say "I do not have programming skills", well that's alright -alright in the beginning. Otherwise you should become exceptionally good at testing without the use of coding knowledge(people call it as Manual testing), and you should showcase it, and that's hard to achieve, since many good great testers do code!

If you think that, only developers earn better than testers, I'm here to say, it's not. Good testers with programming skills earn equally or even better than the developers.

So, testers, if you're into testing for more than a year or just initiated, please learn any programming language, that will give you some insight, you can have a better control of what you're looking at and how it is driven, from where you will get more knowledge/power to break it -think Tester.


Snippet from Elisabeth Hendrickson's blog post, with some statistical records,

The bottom line is that our numbers indicate approximately 80% of the job ads you’d find if searching for jobs in Software QA or Test are asking for programming skills.No matter my personal beliefs, that data suggests that anyone who is serious about a career in testing would do well to pick up at least one programming language.So which programming languages should you pick up? Here were the top 10 mentioned programming languages (including both required and nice-to-haves):

  • SQL or relational database skills (84)
  • Java, including J2EE and EJBs (52)
  • Perl (44)
  • Python (39)
  • C/C++ (30)
  • Shell Scripting (27) note: an additional 4 mentioned batch files.
  • JavaScript (24)
  • C# (23)
  • .NET including VB.NET and ASP.NET but not C# (19)
  • Ruby (9)
Great Learning!!!!

Thursday 20 November 2014

Automation beyond testing


I was asked to take screenshots of every page of few web applications and put it in a demo site's root folder.

This is not the first time, that i'm doing this kind of work, which i feel too lazy to do it. But then this time learning a programming language, a tool and the 'Lazy' part helped me doing this in lesser time.

Wrote a piece of code in a matter of minutes, and by just browsing through the pages did its task.. this saved me a lot of time.

So creating an executable, and putting it in our space, will help any one who needs to take screen shots :)

I'm not saying this is a great work or a life saver, but it helped and that matters!!

What i learned:

  • Identifying the right scenario and automating it will save you lot of time, so you have more time to test the ambiguous!!
  • Be prepared, you need to have enough weapons in your armoury, it will save you lot of blood 


Code snippet:

You simply browse the pages of your website and the screen shot will be getting saved to your system!!

What you need:

  • Java
  • Jar files for Selenium WebDriver
  • And a basic understanding of coding
  • Any tool to run this code (say Eclipse IDE)

import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
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 Screenshots {

static WebDriver driver;
static String url = "http://www.google.co.in/"; // Specify Your website URL
static String folderpath = "d:\\Screenshots"; // Where you want to save it?
static int FilenameAndCount = 1;
static int screenshotInterval = 3; // In Seconds
static int maxScreenshot = 100; // How many screen shots you need!!

public static void setup() {

driver = new FirefoxDriver(); // I'm using Firefox browser 
driver.get(url); // Open the website
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.manage().window().maximize();

}

public static void takescrshot() throws IOException, InterruptedException {

try {
File scrFile = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(folderpath + "\\"
+ FilenameAndCount + ".png"));

FilenameAndCount++;
} catch (Exception e) {
System.err.println("e");

}
}

public static void main(String[] args) throws IOException,
InterruptedException {

setup();
try {
while (FilenameAndCount <= maxScreenshot) {
takescrshot(); // Call Screenshot method
Thread.sleep(screenshotInterval * 1000);

}
} catch (Exception e) {
System.err.print(e);
}
System.exit(1);
driver.quit();

}
}

                                                        ***************