Archive | Tester RSS feed for this section

Some links for intergrating Jenkins for Selenium

26 Aug

http://www.learn-automation.com/p/jenkins-for-selenium.html
http://www.browserstack.com/automate/continuous-integration
http://www.ontestautomation.com/running-selenium-webdriver-tests-in-jenkins-using-ant/

They are so useful

Unit Testing and Test Automation in VS2012 Part 2: Integrating Selenium with Visual Studio

4 Jul

In the first part of this series we discussed about integrating NUnit with Visual Studio 2012. One of NUnit’s strong points is its extensibility which has been used to expand unit testing even further — as far up as the user interface in fact. This is where Selenium comes in.

Selenium runs on top of NUnit so that it can run tests against instances of web browsers. With the new testing features of Visual Studio 2012 we can now use it to test web applications.

If you haven’t read the first part of this series and haven’t followed the steps given there, I suggest reading it now and following the steps to install NUnit on Visual Studio 2012 first. They are a prerequisite to the next steps in this article.

Integating Selenium into Visual Studio 2012

Since we’ve already integrated NUnit to our Visual Studio solution, why not go all the way and use Selenium as well? Selenium uses the NUnit Framework for its tests anyway — it’s just a matter of adding several more components to allow Selenium’s Webdriver to fire up a web browser and start executing tests.

To do this we need to extend our project a bit:

  1. Open up the Manage NuGet Packages window again (right-click on References under the project -> Manage NuGet Packages) and in the search box type “Selenium”
  2. Select “Selenium Webdriver” and click Install to add Selenium references to your project.
  3. Select “Selenium Webdriver Support Classes” and click Install — these are some additional references necessary to run Selenium tests in your Visual Studio solution.
  4. Download IE Webdriver from the Selenium download page (choose the appropriate 32 or 64 bit version) and unzip.
  5. Righ-click on the project name and click “Add existing item…”
  6. Browse to the folder containing IEDriverServer.exe and choose that file to add to the project
  7. Under the project tree right-click on the file and click Properties
  8. Set the value of the field “Copy to Output Directory” to “Copy if newer”

The steps regarding the web driver ensure that the exe required to open up a browser is always copied to the /bin/Debug folder, from where it will in turn be used to call on the browser executables and open up the browser.

We can use the project we already set up above to test this. Add a new class and set it to have the following code. Note the additional OpenQA using declarations, aside from the NUnit.Framework that we’ve used before:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
namespace TestAutomation
{
    [TestFixture]
    public class Driver
    {
        IWebDriver driver;
        [SetUp]
        public void Setup()
        {
            // Create a new instance of the Firefox driver
            driver = new InternetExplorerDriver();
        }
        [TearDown]
        public void Teardown()
        {
            driver.Quit();
        }
        [Test]
        public void GoogleSearch()
        {
            //Navigate to the site
            driver.Navigate().GoToUrl("http://www.google.com");
            // Find the text input element by its name
            IWebElement query = driver.FindElement(By.Name("q"));
 
            // Enter something to search for
            query.SendKeys("Selenium");
 
            // Now submit the form
            query.Submit();
 
            // Google's search is rendered dynamically with JavaScript.
            // Wait for the page to load, timeout after 5 seconds
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
            wait.Until((d) => { return d.Title.StartsWith("selenium"); });
 
            //Check that the Title is what we are expecting
            Assert.AreEqual("selenium - Google Search", driver.Title);
        }
    }
}

Run the tests again. The test should open Internet Explorer and then open up Google. The result in the Test Explorer would look like this, just like our NUnit test:

Conclusion

With the capability to tightly integrate NUnit and Selenium in Visual Studio 2012 solutions and projects, Microsoft redeems itself by rectifying the ghosts of MSTest: it brings unit testing much closer to coding, it finally allows test-first/test driven development, and it opens up the capability for third-party unit testing frameworks to run in Visual Studio as first class citizens. This allows other open source testing frameworks like xUnit.net, QUnit/Jasmine, and MbUnit to run seamlessly with Visual Studio 2012.

References

I’d like to point out Anoop Shetty’s blog post on Selenium integration from which I took the steps and code for the Selenium test used in this post. While his post was applicable to Visual Studio 2010 the steps were practically the same for Visual Studio 2012.

Unit Testing and Test Automation in VS2012 Part 1: Running NUnit natively in Visual Studio

4 Jul

One of the most criticized features of Visual Studio ever since it came out has been the ability, or lack and inadequacy thereof, of the IDE to integrate third-party unit testing libraries into it. MSTest was not only too late but was also too lame — it wanted users to rely on automatically generated tests put up after code has already been written. This runs so counter to the tenets of Test Driven Development that MSTest was simply ignored, and many developers came up with ways to hack third party unit-testing frameworks like NUnit, MBUnit, xUnit and so on for their .NET projects. Inevitably, Microsoft and MSTest ended up being vilified by the believers of TDD.

With Visual Studio 2012 Microsoft provided a means of using frameworks like NUnit and Selenium to actually be run within its IDE, in a tightly integrated way, and in turn, the ability to code test-first.

Let’s talk about how to make that happen.

Setting up the NUnit Test Adapter

First in our agenda is to wire Visual Studio 2012’s testing framework to NUnit. To be able to do this we need to download and install the NUnit Test Adapter extension, which we will do via Visual Studio’s “Extension Managers” feature:

  1. With Visual Studio 2012 started, go to the Tools Menu and click on Extensions and Updates
  2. On the left tab click on “Online” and on the Search field on the upper right type in “NUnit Test Adapter”. You will need an internet connection for this to work.
  3. When the NUnit Test Adapter item appears click the “Download” button. Once the download is complete follow the instructions to install the NUnit Test Adapter
  4. At the bottom of the window you may be asked to click “Restart Now” to allow the newly installed components to take effect within Visual Studio 2012.

Once you’ve finished this Visual Studio 2012 is now ready to run NUnit tests within the IDE.

Creating your first NUnit test project

Let’s now create our first NUnit test project.

  1. Go to File -> New -> Project and under Visual C# choose “Class Library” and rename to “NUnitTestDemo”. You may also want to rename your “Class1.cs” into something more sensible.
  2. In the Solution Explorer right-click on references then click “Manage NuGet Packages”.
  3. On the left tab click on “Online” and then on the Search field type “NUnit” this time. When the result appears click “Install”.

All the relevant classes required for NUnit should now be included in the project — it’s now time to write some unit tests!

Our bare code so far looks like this (I’ve renamed the project “NunitTestDemo” and the default class “FirstUnitTest”):

1
2
3
4
5
6
7
8
9
10
11
12
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NunitTestDemo
{
    public class FirstUnitTest
    {
    }
}

To check if NUnit works on Visual Studio let’s try adding bits of code and one dummy test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace NunitTestDemo
{
    [TestFixture]
    public class FirstUnitTest
    {
        [Test]
        public void TrueTest()
        {
            Assert.IsTrue(true);
        }
    }
}

To run this test, click on the Test menu, Run, then All Tests. You could also use the shortcut Ctrl-R, then A.

The test result under the new “Test Explorer” tab will look like this:

Details like the name of the tests and execution times of both individual and all tests appear in this tab.

Let’s add a failing test just to see what it looks like:

1
2
3
4
5
[Test]
public void MathTest()
{
    Assert.AreEqual(0, 1 + 1);
}

Running the tests again, the result would look like this:

Additional details come up — highlighting the failed test reveals the expectations of the failing test, the actual result, and even the stack trace, crucial for figuring out why the test is failing.

You’re now ready to use NUnit to code test-first for your classes.

But you could also use it for your front-end code, particularly web applications. On the next installment of this 2-part series I’ll show you how to use Selenium for front-end testing in Visual Studio.

References

Peter Provosts’s presentation on Visual Studio 2012 unit testing features in TechEd Europe was a crucial reference for this post.

how to set up an environment and test Android application using Selenium

19 Jun

Android WebDriver allows to run automated end-to-end tests that ensure your site works correctly when viewed from the Android browser. Android WebDriver supports all core WebDriver APIs, and in addition to that it supports mobile spacific and HTML5 APIs. Android WebDriver models many user interactions such as finger taps, flicks, finger scrolls and long presses. It can rotate the display and interact with HTML5 features such as local storage, session storage and application cache.

We try to stay as close as possible to what the user interaction with the browser is. To do so, Android WebDriver runs the tests against a WebView (rendering component used by the Android browser) configured like the Android browser. To interact with the page Android WebDriver uses native touch and key events. To query the DOM, it uses the JavaScript Atoms libraries.

This link is good to learn how to setup and test Android app using Selenium

http://code.google.com/p/selenium/wiki/AndroidDriver

Tips for ISEB and ISTQB exams

5 Dec

Just read a good link, so want to share it to everyone who want to get ISTQB certificate.
Hope that I have much free time in next year to learn and take this exam
——————————————————-
Introduction
I would like to share with you my experience with the exam. The opinions presented in this article are my personal thoughts, feelings and ideas.

Let’s not go into debate if certification is needed and if it has real benefits. For arguments pro certification you can check http://www.testingexperience.com/testingexperience01_08_Black.pdf  and for arguments against you can refer to http://www.satisfice.com/blog/archives/36. The choice is yours.

After Foundation Level, you need to choose certification path ISEB or ISTQB. I took ISTQB since having advanced level with 3 specializations makes sense from carrier development point of view and the path Foundation -> Advanced seems to be straight forward. The Expert level created recently with 4 specialities seems to be over the top. You can read more about the ISTQB certification path here: http://istqb.org/display/ISTQB/Certification?atl_token=93VdaeFKJJ

ISEB tries to split hair in four with Foundation->Intermediate->Practitioner->Advanced levels. I think, it’s too much effort to get to advanced level. More about ISEB certification path can be found here: http://www.bcs.org/server.php?show=nav.10920. And actually ISEB has announced recently that Practitioner Level certification will be possible only till 15 March 2010 and they switch to ISTQB certification only. There is one, quite nasty effect of such solution. Nowadays you can see mistakes in job offers like ISTQB Practitioner level required. Who is going to tell which Advanced certificate you have? ISEB or ISTQB? So in most of cases you will have to defend yourself that you have chosen longer certification path.

I have passed exam for ISEB Certified Tester Foundation Level and ISTQB Certified Tester Advanced Level – Test Manager exams, so I will write a bit about both levels.
Preparation for exam

First of all for every exam you need to prepare. Question about preparation is the most asked one. Some people say that you don’t need any preparation, others say that you can not pass the exams without proper training.

What is my opinion?

From my experience I can tell you, that answer to that question is tricky. For the Foundation Level the syllabus provided by the organization should be enough as source of theoretical knowledge, but … Reading book about testing in general, like Software Testing by Ron Patton is highly recommended. Professional experience as a tester can both help you and disturb you. Why? That depends on terminology and methods used on the projects you took or take part in. If on the project everything is set-up and named according to ISEB/ISTQB syllabus and vocabulary, exam should be easier for you, you can refer to “how do we do that on the project?”. If not, you will be very confused and the referring to “how do we do that on the project?” will just fool you. Preparing for foundation level, you don’t need to worry much about the Reading List at the end of syllabus.

Don’t forget to read vocabulary and learn the terms that are in there. Look at these simple questions: what is Test Case and what is Test Procedure, what’s the difference between them? Did you get it right? It’ s very easy to give a wrong answer if you are confused by terminology.

If you are not sure about following the standard on the project, go for training. Then you should have clarity and your knowledge will be ordered.

There is big question about self-preparation. Are you really going to seat and learn in the evenings and weekends? If not – better go for training.

With preparation for Advanced Level, the case is even more complicated. The Syllabus is for sure not enough. It looks more like set of guidelines, description of scope. Experience from projects can help you, but whatever is your experience, most probably you are not familiar or you simply don’t remember all test process improvement methods and all software development methodologies, frameworks. Going for training is definitely a good idea.

Full certificate is split nicely into three parts with a reason. It’s a lot of material to learn and understand, especially for Technical Test Analyst module. It’s better to prepare to and pass them one by one.

When you study, a good idea is to make notes in form of Mind Maps. I find this form very useful and easy especially for quick refreshing of my knowledge.

For Advanced Level Test Manager, there are few books that can be used for preparation

The yellow one – Software Testing Practice: Test Management: A Study Guide for the Certified Tester Exam ISTQB Advanced Level by Andreas Spillner, Tilo Linz, Thomas Rossner, and Mario Winter

The black one – Advanced Software Testing – Vol. 2: Guide to the ISTQB Advanced Certification as an Advanced Test Manager by Rex Black

The green one – Guide to Advanced Software Testing by Anne Mette Jonassen Hass

I can recommend you the green one. It worked for me really well.

For the two Analyst modules we have a similar set:

The Software Test Engineer’s Handbook: A Study Guide for the ISTQB Test Analyst and Technical Analyst Advanced Level Certificates by Graham Bath, et al.

Advanced Software Testing – Vol. 1: Guide to the ISTQB Advanced Certification as an Advanced Test Analyst by Rex Black
General tips and tricks for exam
1. The best and most successful trick is: do the study or go for training or do both.

2. For both ISEB and ISTQB you can find example exam questions in the internet. It is wise to take these exams and get used to the form of questions.

3. Studies show that when you have answered a question and you change the answer because you are not sure – usually you change it to wrong one.

4. Having the exam on the last day of training is not very good idea. You can be brain-fried and it will be difficult for you to focus and understand questions. But don’t postpone the exam for longer that 2 weeks – then most probably part of the knowledge acquired on the training will be vanished and in practice you can start studying all over again.

5. Questions are quite long, often describing specific situation on the project, so useful thing is to highlight/underline the question itself and highlight the most important context of the situation i.e. safety critical/non-safety critical. Always search for keywords. Why is it so important? Because in the text there are introduced so called distractors. And as you can guess, the role of distractor is to bring your focus and attention to the least important information.
6. There are no negative points for incorrect answers. If you really don’t know the answer, feel free to guess. In worst case you will get 0 points.

7. You don’t have to answer questions in order. First go through the examination sheet and answer to questions, you are sure about. For questions where you have doubts mark the most likely answer on the side of page or just move to the next one. Mark that page with some sign like question mark to find it easily later. Why to use such a technique? Because if you are short on time you can just guess answers to the rest of questions having questions you were sure about answered.

8. Roman Type questions – it is a variation of multiple-choice question. You have presented several statements in an ordered list marked with letters or Roman numerals (thus the name). Your task is to chose the right combination of true statements. Let’s see an example:

Which of the following answers reflect when Regression testing should normally be performed?

1) B & D are true, A, C & E are false
2) A & B are true, C, D & E are false
3) B,C & D are true, A & E are false
4) B is true, A, C, D & E are false

How to deal with that type of question? At the first glance they look like you have choice of 4 answers, what seems to be difficult. But

you can lower number of options by selecting 100% right and 100% wrong options. In the example above A, C are bold statements and are 100% false, therefore options 2 and 3 can be excluded.

A. Every week
B. After the software has changed
C. On the same day each year
D. When the environment has changed
E. Before the code has been written

1) B & D are true, A, C & E are false
2) A & B are true, C, D & E are false
3) B, C & D are true, A & E are false
4) B is true, A, C, D & E are false

We have 2 options now. B is in both, so it’s clear that Regression Testing should be done after the software has changed. What about environment? Environment can also influence results of testing because it’s changing the Test Conditions, therefore B and D are true, so the correct answer is option 1.
Foundation Level
1. On foundation exam you need to pay attention to previous questions. Sometimes answer to current question is in the stem of the previous one.
2. Quite a lot of questions contains parts of even whole sentences from Syllabus.
Advanced Level
1. At least in exams provided by GASQ questions are marked with level of difficulty and have weights K1 – 1 pts, K2 – 2 pts, K3 – 2pts. So if you have choice where to spend more time, go for K2 and K3 questions.
Conclusion

And that would be it. Pick you certification path. If you are just starting, better go for ISTQB path, which has future and takes less effort. The choice of taking training or not is yours. I hope you find this article helpful and have something to base your decisions on.

Good luck on exam!
Resources

http://www.academictips.org/acad/multiplechoiceexamstips.html
http://www.eviltester.com/index.php/2008/02/06/my-notes-on-how-to-study-…

———————————–
Source: http://kaczor.info/pl/node/73

[Selenium Tutorial] Selenium Grid Overview

3 Dec

This slide will provide for us overview about selenium grid basically

– What is Grid?
– What is Grid Computing
– Selenium Grid
– Selenium Grid Architecture

I got this from Internet

Copyright by Kangeyan Passoubady (Kangs)
Link download: Link

Agile Software development

13 Oct

I heard much about Agile keywords but really do not have time to investigate what is it. Today I got some information and really enjoy this keyword. Actually, we have so many things to learn and investigate ^^.

As wikipedia.com, Agile software development is a group of software development methods based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development and delivery, a time-boxed iterative approach, and encourages rapid and flexible response to change. It is a conceptual framework that promotes foreseen interactions throughout the development cycle. (Source http://en.wikipedia.org/wiki/Agile_software_development)

For more detail resource about this keyword, you can read this ebook.

INTRODUCTION Unknowable and Incommunicable 13
The Problem with Parsing Experience 14
The Impossibility of Communication 17
Three Levels of Listening 22
Chapter 1 A Cooperative Game of Invention and Communication 28
Software and Poetry 29
Software and Games 30
A Second Look at the Cooperative Game 35
Chapter 2 Individuals 43
Them’s Funky People 44
Overcoming Failure Modes 47
Working Better in Some Ways than Others 52
Drawing on Success Modes 61
Chapter 3 Communicating, Cooperating Teams 69
Convection Currents of Information 70
Jumping Communication Gaps 81
Teams as Communities 88
Teams as Ecosystems 95
What should I do tomorrow? 97
Chapter 4 Methodologies 100
An Ecosystem That Ships Software 101
Methodology Concepts 101
Methodology Design Principles 120
XP Under Glass 139
Why Methodology at All? 142
What Should I Do Tomorrow? 144
Chapter 5 Agile and Self-Adapting 146
Light But Sufficient 147
Agile 149
Becoming Self-Adapting 153
What Should I do Tomorrow? 161
Chapter 6 The Crystal Methodologies 164

Link download in here download

[Slide] Selenium Tutorial – How to Install Selenium RC – step by step

6 Jul

This document will help you to setup Selenium RC

– JRE 1.5 or later
– Selenium RC Server
– Ruby Selenium Client
– Try to run an example with Ruby Test

(Source from Internet)

You can download in link
There are more slides about Selenium Tutorial, I will upload later.

Hold a small tutorial group to learn Selenium

21 Jun

Hello everyone,

I am beginner in investigating about Selenium, so I’d like to hold a small group with everyone who likes to investigate Selenium like me or who had already experience with Selenium and want to share your knowledge. If you are interested in, please register by commenting in here or sending email to me mycollection.online@yahoo.com with information as below
– Your name
– Your email
– Your experience about Selenium
– How many hours can you spend to investigate about Selenium per a week?

What you can get after we finish this investigation,
1. Learn how to work with a team and learn by yourself
2. Learn how to make presentation, write guideline in English
3. Get knowledge about Selenium in short time
4. Have new friends around the world

Let’s join together ^^

I expect our project will start from the beginning of July 2012 and ending about Nov 2012 depends on the number of registered persons. I will share detail plan after receiving your registration. Hope that we can cooperate to share knowledge about Selenium together.

Learn to share and share to know more ^^
12

How to write effective GUI test automation code using Selenium and Java

12 Jun

Just searching on Internet and got this document. In this presentation, you can get some useful information about how to write effective GUI test automation code using Selenium and Java

1. Introduction: What’s Selenium
2. What we achieved
3. 7 good practices using Capture Replay Tools

– GUI element repository.

– Division of data and script.
– Model the test objects.
– Establish standard functions and methods using “speaking” names.
– Central management of environment information.
– Divide common from project specific stuff. Use layering.
– Generate a useful test report
4. What’s missing in Selenium and how we closed the gap
5. Forecast

You can download in link