Twist creating a Generic Checkpoint Method

public void applyCheckpoint(String propname, String locator,String valueToVerify)
{

String locatorWithAttribute =locator+"@"+propname;

Assert.assertEquals(selenium.getAttribute(locatorWithAttribute), valueToVerify);


}

Twist can now talk to Proxies

May be little early to post as official build is not GA yet.

But I got to test the latest build, and now Twist can work on external proxies. :)

However, there are few changes needs to be mad eto twist.propeerties file and applicationContext-suite.xml.

1) Changes to twist.properties
  • selenium.server.options = -port 4545 -avoidProxy
(Default behavior is, twist works on proxy injection mode. Change that to have above code)
  • selenium.browserLauncher=*firefox
(Default behavior of Twist is to record on Firefox on *pifirefox mode), change that to have *firefox.
  • selenium.browserURL=http://www.xyz.co.uk
(Default setting are localhost:4545, however in order to work with proxies enter your application URL here, since twist would not record if you try to change the domain from URL X to URL Y while recording)

Though I personally beleive user should not worrry about setting the URL at settings level, as this is contextual thing and I have to switch this setting everytime I need to record on a new application. (Little bit of Pain).

However, I am happy to take this pain in lieu of having Twist working with proxies at the moment.


How to set the Proxy settings ?

2) Changes to applicationContext-suite.xml.

Change the follwing bean tags


bean id="systemproperty"

"entry key="http.proxyHost" value="www.proxy.url""
"entry key="http.proxyPort" value="8080""
"entry key="http.proxyUser" value="""
"entry key="http.proxyPassword" value="""


(Sorry for unformatted XML, as it might not appaer in it's original form)

Twist - Creating a Google Test

- Create a Twist Project, by clicking on File - New - Twist Project.
- A wizard will be opened, Enter a project name and choose advanced option to selenium driver. (That's the driver needed for web testing)

- Leave other options unchanged, if you want selenium server to run on another port change the port number.

Once Project is created , It will ask you to create a new scenario, enter some name to it and click on Finish.

To make it a executable test, one need to create a work flow.

- Click on Work flow button on top of the test, it will add a blank scenario something like.



New Work flow:


A bullet point will also be inserted, specifying that as scenario step.

- Change the scenario name if needed and then put the cursors on scenario name to make it executable.
- Click "Ctrl+1" to create a workflow (That is java class with the workflow name), after that is done the color and font style of the workflow name will be changed to Black and Normal from Italic respectively. It denotes that workflow has been created, however there are no tests specified in that.

- Now create test steps - Create one test step each against a bullet point.

  • Open website "www.google.co.uk"
  • Enter search criteria "Testing"
  • Verify Search Result "Testing"

Once Testing steps are defined, one need to elaborate them to make it executable.

Sale rule as we did with workflow, put the cursor on the step name and click "Ctrl+1", it will give two options

1) To create the blank method in the Java class created above.
2) To record the method using "Firefox " (Does not support any other browser for recording at the moment).

If option 2) is selcted then a browser is launched and user can perform actions ..

Lets record out first step - 1) Open website "www.google.co.uk"

Once the browser is launched, type "www.google.co.uk", and then to mark the recording finished click on "Done" on recording pane (Can be seen on right hand side).

Now, Twist must have inserted some code for this methods 1) Open website "xxx"

Code can be seen by pressing "F3" on the method name, it will then navigate to the specific method , by highlighting the method in the code.

That's what we get in the code..


public void openWebsite(String string1) {
selenium.open("www.google.co.uk");

}



Now, this method can be made reusable by using parameter string1, that is the google url in the test, instead of using hard coded value. So, now the method would look like.



public void openWebsite(String url) {
selenium.open("url);

}



Now, this method can be used to open any URL..

Twist - Next Step


Today we moved our Twist project to SVN, and let me admit that movement to SVN and checking out the project was pretty smooth.

However, we did see an issue, we had changed the project name while checking out the project. In that case it would not show the Auto suggestion for already existing methods. (See the Pic..).

Twist allows you to reuse any existing action from across the tests. For e.g> If i had defined a a method to open a URL for my tests, I can simply reuse it with passing different URL as parameter.


In my next post I will explain how to create a basic test in twist.....

Twist - Learnings

We have started looking out to use Twist for this project we are currently doing for a client.

Twist is a tool for Automated acceptance testing by ThoughtWorks. The power of Twist is in the simplicity of the tool. Twist is built upon the Eclipse IDE which is a Java IDE.

One can write the Tests in English like syntax and then it can be extended to define the logic behind these English sentences.
It allows you to reuse the previously used sen tenses/test components in a very easy and Intuitive way.

I will keep posting my leanings on this..

Agile Testing - Few facts

  • In an agile team Quality is “everyone's responsibility”.
  • QA team continuously measures the Quality and provide the feedback.
  • Role of QA changes many times within the life cycle of the Iteration.
  • Test Automation is used to eliminate the time waste and Increase the Test coverage for “Any time Regression”.
  • Automation helps QA’s to focus on exploratory testing, as one can focus on other important stuffs.
  • Quality is not added later, it evolves gradually.

Traditional

Agile

Change

Manage & control it

(Hard to accommodate)

Change is inevitable

Planning

Comprehensive up

front design

Plan as you go

Collaboration

Work alone

Work with Devs and BAs

Hand Offs

Formal entrance and

exit criteria

It’s not a relay race:

collaborate

Test Automation

System-level, built by tool specialists,

created after the code is “done”

All levels, built by

everyone, an integral

part of the project

Web Automation - Is as simple as?

I have worked on various tools for web automation so far, and I see web automation as a simple mechanism if we break them in to generic actions (Be it any tool/Language).

I would call them Four basic and only pillars.


1) Click - Button, Link, Image
2) Select Drop down, option, radio etc
3) Navigate URL
4) Verify Text (On a page, in a Textbox, in a Table, in a Div , page title)

Mumbai Attacks

ऐ दिल हैं मुश्किल जीना यहाँ
ज़रा हट के ज़रा बच के
ये हैं मुंबई मेरी जान

Means :

This is really difficult to Live in Mumbai.
Be careful
This is my Mumbai

Rightly said and it has become increasingly difficult to Live here. Thanks to "resilient" Indian nature (At least that's what we are called by these politicians).

"Enough is Enough" is the say of the moment and rightly so, we can not keep being mum and letting these politicians play their vote politics.

People who came on the Boat can be caught, what do we do with these people who came by "Vote".

"We have proof who these terrorist were", then what are we waiting for, Another attack? I think they lack will power. We definitely don't lack the courage and military power.

Last few months Mumbai was busy beating Biharis and Bhaiyas. Police was proud of killing Rahul raj (Bihari Youth), same Mumbai police was seen (Not all of them) running around in CST station when these terrorists strike. Mr. Raj thackrey was busy making his vote bank, being "Aamchi Mumbai" well wisher. And on top of that congress was buys proving "Hindu Terrorism" (If at all that exists).

Mr Thackrey, Please wake up now and think beyond the politics; At least for your "Aamchi Mumbai".

And I sincerely appeal to Mr Amar Singh to sponsor a advocate for one the live terrorist so that he can add few more votes to his kitty.

Mr Amitabh bachhan, if you have lost your sleep in Mumbai then I think you should have really commended Mr Amar Singh's act of questioning the Batla house encounter. Don't worry Sir, you will be safe, Lets us worry about common man.


At last I really salute the Army, NSG and Police who did a commendable job fighting the situation out.

Jai hind.

QTP for Agile acceptance testing

It may sound crazy..but its possible.

What if you have already got QTP Licenses and you want to use that for Automated acceptance testing.

There is no second doubt that QTP is a very robust and easy to use, and uses standard VBScript for the scripts.

QTP support launching of the Testsuite using commoand line and may very well be used for cruise integration, obviously not for regular builds. However, using QTP for nightlt build is not a bad idea at all.

I have tried it once in a project and it works well.

Scripting language vs Programming language

I think this questions would be haunting in lot of mind's.

But I have my concerns with Programming language used for writing Functional automated tests.

At first instance I think programming languages like Java and .Net are too object oriented for automated tests, after all our purpose is to make the tests work easily not worrying too much about achieving object oriented design for that. And often reading back the scripts becomes too complicated because we (QAs) tend to follow what programming languages are intended for.

Other problem obviously is the skill you need to develop to write tests in these languages. As an Automated tester I really don't care about a method being declared as Public or Private or Static for that matter, what I really want is way to achieve "Reusability" in a simpler and effective way.

On the other hand I think scripting languages give you a free hand to use the language in a much simpler way and in a good enough, clean and effective way that you can make your automated testing framework more Robust, Reusable and at the same time easy to maintain for everyone.

So, I leave this topic for discussion here.

Pankaj