Saturday, August 29, 2009

Automate Web Service Testing the Right Way

Web services Web services are perfect candidates for automated testing. Compared with validating a UI, Web services Web services testing is quite simple: send a request, get a response, verify it. But it's not as easy as it may look. The main challenge is to identify the formal procedures that could be used for automated validation and verification. Other problems include dynamic data and differing request formats.

In the project our team was working on when this was written, there were many different Web services in need of testing. We needed to check not only the format of the request and response, but also the business logic, data returned by the services and the service behavior after significant changes were made in the architecture. From the very beginning we intended to automate as many of these tests as possible. Some of the techniques we used for automated verification of Web services functionality were as follows:

1.Response schema validation.
This is the most simple and formal procedure of response structure verification. There are free schema validators out there that can easily be built into automated scripts. However, schema validation is not sufficient of you also need to validate the Web services logic based on data returned from a service.

2.Comparison of the actual response with the expected response.
This is a perfect method for Web service regression testing because it allows for checking of both response structure and data within the response. After the successful manual validation, all valid responses are considered correct and saved for future reference. The response of all next versions of that Web service will then be compared with these template files. There is absolutely no need to write your own script for XML file comparison; just find the most suitable free tool and use it within your scripts. However, this method is not applicable when dealing with dynamic data or if a new version of Web services involves changes in the request structure or Web services architecture.

3.Check XML nodes and their values.
In the case of dynamic data, it can be useful to validate only the existence of nodes using XPath query and/or check the node values using patterns.

4.Validate XML response data against original data source.
As a “data source” it’s possible to use database, another service, XML files, non-XML files and in general, everything that can be considered a “data provider” for Web services. In combination with response schema validation, this method could be the perfect solution for testing any service with dynamic data. On the other hand, it requires additional skills to write your own scripts for fetching data from data source and comparing it with service response data.

5.Scenario testing.
This is used when the test case is not a single request but a set of requests sent in sequence to check Web services behavior. Usually the Web services scenario testing includes checking one Web service operation using another. For example, you can check that the CreateUser request works properly by sending a GetUser request and validating the GetUser response. In general, any of the above techniques can be used for Web services scenarios. Just be careful to send requests one after another in the correct order. Also be mindful of the uniqueness of test data during the test. The service might not allow you to create, for example, several users with the same name. It’s also common for one request in a sequence to require data from a previous response. In this case you need to think about storing that data and using it on the fly.

All of these techniques were implemented using a home-grown tool which we were using in our day-to-day work. Using that tool, we are able to automate about 70 percent of our test cases. This small utility that was originally created by developers for developers to cover typical predefined test conditions and gradually evolved into rather powerful tool. Having such a tool in your own organization could help your testing efforts well into the future.

Source: http://www.stpmag.com

Thursday, August 27, 2009

W3C XML schema

XML schema is some other XML file which like DTD defines the type of document contents. Ths most famous is W3C XML schema but there could other means to declare the document. An example below shows generic XML schema content. Its root element is schema. Besides namespace-prefix mapping it can contains some set of attributes. Here we enable full-qualified names for elements and names only (without namespace prfixes) for attributes:


http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">





source: java-tips.org

Tuesday, August 25, 2009

User Extension for gotoLabel command

We can use loop concepts in Selenium IDE:
Here is the user extension for gotoLabel command.

Selenium.prototype.doGotolabel = function( label ) {
if( undefined == gotoLabels[label] ) {
throw new Error( "Specified label '" + label + "' is not found." );
}
this.continueFromRow( gotoLabels[ label ] );
};

Sunday, August 23, 2009

Increase your system performance

We all like the colourful Windows XP desktop. But this GUI (graphical user interface) is using a lot of system resources.You can optimize your MS Windows XP performance by disabling some of these visual effect.

To optimize your Windows XP:-
1. Click Start => Setting => Control Panel
2. Click System => Advance Tab
3. Click Settings button under Performance
4. Under Visual Effects tab, select Adjust for best performance (all the check boxes will be unchecked)
5. Scroll down the list and check “Use Common Tasks in Folders”
6. Click OK and OK again.

Your Windows XP will now has less colourful and lesser visual effect and it will look like MS Windows 98 but do not forget that your system performance would have been by increased now !!!

Source: www.techiecorner.com

Friday, August 21, 2009

Example for gotoLabel command in Selenium IDE

Here is the example for gotoLabel command. When Selenium IDE encounters gotoLabel command, it searches for targetted label name in the rest of the script and passes the control to targetted Label and the executes the steps from Label command and skips the steps that are in between gotoLabel and Label commands. When the targetted label is not found it throws error.

Extension for Label Command:
Selenium.prototype.doLabel = function(){};

Example:


http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
http://selenium-ide.openqa.org/profiles/test-case">

http://www.google.co.in/" />
New Test

























































New Test
open http://www.google.co.in/
verifyText link=Go to Google.com Go to Google.com
gotolabel label1
clickAndWait link=Go to Google.com
verifyTextPresent this wont execute
clickAndWait link=Go to Google India
label label1
verifyTitle Google




Wednesday, August 19, 2009

Learn Vocabulary through SMS

Do you want to imrove your vocabulary ,I guess a word a day will help you.
Here are few internet sites which will send you a word a day thru SMS.

http://labs.google.co.in/smschannels/subscribe/wordoftheday
http://www.kaaledge.com

Do register your mobile in these sites and improve your vocabulary.

Monday, August 17, 2009

Restarting Windows Without Restarting Your PC!!!

A modern PC with Vista Home Edition takes about one and a half minutes to boot. An older machine with XP is about the same. That’s 30 seconds for the PC itself (the BIOS) to boot up, plus a minute for the Windows operating system to boot.

Sometimes, you need to reboot Windows (e.g. when installing new software), but there is no need to restart BIOS, too. However, the default is to reboot both. (That’s called doing a “cold boot,” rather than a “warm boot.”) There’s a trick that works on both XP and Vista to get it to do a warm boot instead, thus saving you 30 seconds per cycle.

The trick is to hold down the SHIFT key when invoking the restart.

Windows Vista:
Select Start, then hover over the right arrow that is to the right of the padlock icon until the pop-up menu appears that contains “restart” as one of it’s choices. Hold down the SHIFT key while clicking on the “restart” choice.

Windows XP:
Select Start. Select “Shut Down…”. Change the drop-down combo box under “What do you want the computer to do?” to “Restart”. Hold down the SHIFT key while clicking on the “OK” button.

Source: http://pcpandit.com/index.php/windows/restarting-windows-without-restarting-your-pc.html

Saturday, August 15, 2009

Generating random number

First you would need to create an instance of Random class:
Random random = new Random();
Then, you can get your random number by calling:
int pick = random.nextInt(maxvalue);

This would return a value from 0 (inclusive) to maxvalue (exclusive).

For a more cryptographically strong pseudo random generator you may check out java.security.SecureRandom class. Here the caller may specify the algorithm name and (optionally) the package provider. Here is a sample code of using SecureRandom class:

SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(seed);
int randInt = random.nextInt(maxvalue);

source:java-tips.org

Thursday, August 13, 2009

PureMVC Framework for JavaScript Available

PureMVC has been ported to JavaScript !

Download the Javascript port from the following links.
PureMVC Port for JavaScript - http://trac.puremvc.org/PureMVC_JS PureMVC JS Employee Admin - http://trac.puremvc.org/Demo_JS_EmployeeAdmin

Tuesday, August 11, 2009

Nesting Master Pages

There are times where you may want to provide overall branding and appearance for your Web site, but at the same time provide sub-sites whose appearance must be consistent. To accomplish this, you need to nest one master page within another page, a process called "Nesting Master Pages". Nesting support is built-in, which means you don't have to do anything special to reap the advantages of nested master pages; a content page that uses a sub-master page will automatically receive content from all the master pages in the hierarchy.

Using the master pages architecture, you could implement a consistent look and feel across all the developer centers. For example, you can have the main MSDN page derive from a root master page. Each developer center can have its own master page, each of which uses the root master page as its master. This means a content page in any of the developer centers will inherit the root master page look and feel settings that provide overall MSDN branding, and will also inherit the custom look and feel specific to that developer center. This nested approach provides each developer center with the freedom to develop customized content while maintaining a consistent overall branding for the entire site.

ref:devx

Sunday, August 09, 2009

Configuring Master Pages

So far, you've used the master attribute of the Page directive in the content pages to specify the name of the master page. Even though this approach works, it requires you or your developers to specify the master attribute in each page. You can eliminate that requirement by specifying the name of the master file in the web.config file under the pages element. After adding the entry to your web.config file, all the pages in that Web application will automatically use the designated master page. For example, the following web.config file entry specifies that all the pages in the Web application should use IntroMaster.master as their default master page.







You're not limited by setting the default master page in the web.config file. Even when you use this method to specify the name of a default master page, you can still override the global value by specifying a different master page in the master attribute of the Page directive. Any values you specify using the Page directive takes precedence over the web.config file entry.

To sum up, ASP.NET's new Master Pages feature provides a clean approach to encapsulate common functionality and content a centralized location, allowing other pages to inherit from those master pages, thereby greatly reducing the maintenance. Using master pages, you can also create one set of controls and code and apply the results to all your content pages. Apart from providing a fine-grained control over the layout of the content pages, master pages also expose an object model that allows you to access the master page controls, properties and methods from content pages.

ref:devx

Friday, August 07, 2009

Ten things you might not know about Google

1) The name Google is a spelling error. The founders of the site, Larry page and Sergey Brin, thought they were going for 'Googol.' Googol is the mathematical term for 1 followed by 100 zeros. The term was coined by Milton Sirotta, nephew of American mathematician Edward Kasner, and was popularized in the book, Mathematics and the Imagination by Kasner and James Newman. Google's play on the term reflects the company's mission to organize the immense amount of information available on the web. Initially, Larry and Sergey Brin called their search engine BackRub, named for its analysis of the of the web's "back links." The search for a new name began in 1997, with Larry and his officemates starting a hunt for a number of possible new names for the rapidly improving search technology.
2) The reason the google page is so bare is because the founder didn't know HTML and just wanted a quick interface. Due to the sparseness of the homepage, in early user tests they noted people just kept sitting staring at the screen, waiting for the rest to appear. To solve the particular problem the Google Copyright message was inserted to act as an end of page marker.
3) Google started as a research project by Larry page and Sergey Brin when they were 24 and 23 years respectively. Google's mission statement is to organize the world's information and make it universally accessible and useful. The company's first office was in a garage, in Menlo Park, California. Google's first employee was Craig Silverstein, now Google's director of technology. The basis of Google's search technology is called PageRank that assigns an "importance" value to each page on the web and gives it a rank to determine how useful it is. However, that is not why it is called PageRank. It is actually named after Google co-founder Larry Page.
4) Google receives about 20 million search queries each day from every part of the world, including Antarctica and Vatican. You can have the Google homepage set up in as many as 116 different languages –including Urdu, Latin, Cambodia, Tonga, and Yoruba. In fact, Google has the largest network of translators in the world.
5) In the earliest stage of Google, there was no submit button, rather the Enter key needed to be pressed.Google has banned computer-generated search requests, which can sop up substantial system resources and help unscrupulous marketers manipulate its search rankings.
6) The Google's free web mail service Gmail was used internally for nearly two years prior to launch to the public. The researchers found out six types of email users, and Gmail has been designed to accommodate these six. The free e-mail service recently changed its name for new UK users. Following a trademark dispute with a London-based Independent International Investment Research, the mail account has been renamed Google Mail.
7) It would take 5,707 years for a person to search Google's 3 billion pages. The Google software does it in 0.5 seconds. Google Groups comprises more than 845 million Usenet messages, which is the world's largest collection of messages or the equivalent of more than a terabyte of human conversation
8) The logos that appear on the Google homepage during noteworthy days and dates and important events are called Google Doodle. The company has also created an online museum where it has all the logos it has put on various occasions so far.Dennis Hwang, a Korean computer artist in the United States, is the guy behind these witty Doodles. Hwang has been drawing the face of Google for over two years.
9) You have heard of Google Earth, but not many know there is a site called Google Moon, which maps the Lunar surface. Google Moon is an extension of Google Maps and Google Earth that, courtesy of NASA imagery, enables you to surf the Moon's surface and check out the exact spots that the Apollo astronauts made their landings
10) Keyhole, the satellite imaging company that Google acquired in October 2004 was funded by CIA.Keyhole's technology runs Google's popular program Google Earth that allows users to quickly view stored satellite images from all around the world.

Wednesday, August 05, 2009

Folder Option Missing

Many of us sometimes find the folder option missing in the windows explorer.
Here is the solution—>

1.Open Run and Type "gpedit.msc"
2.Now goto User Configuration>Administrative templates>Windows Component>Windows Explorer
3.Click on windows Explorer you will find the thrid option on the right side of screen "Removes the Folder Option menu item from the tools menu"
4.just check it,if it is not configured then change it to enable by double clicking on it and after applying again set it to not configured.
5.I hope that you will find the option after restarting windows.

Monday, August 03, 2009

Multi Google Talk

Just follow the simple steps Below:

1.Right click on google talk shortcut,
2.click on properties
3.Go to shortcut tab on google talk properties window
4.on the target textbox,add in the /nomutex to the end of the line so that it looks like below(or you can simply copy and paste the below syntex and replace the original)
"c:\program files\google\google talk\googletalk.exe" /nomutex
5.click on ok

I didnt have to do anything after this and clicking on the shortcut multiple times just gave me different google talk window.

Saturday, August 01, 2009

How Do You Speed Up Flex Builder?

Here is a article written by Brian Deitte(http://www.deitte.com/archives/2006/12/about_this_blog.htm) , explaining how to speed flex builder

Here are some of things we do:
1.Build every application in one project using multiple source paths (instead of using extra library projects)
2.Build parts of the applications as SWCs (instead of referencing their source paths)
3.Close extra projects
4.Use a system font instead of embedding fonts
5.Run "eclipse -clean" occasionally
6.Turn off "Copy non-embedded files to source folder"
7.Turn off "Build Automatically"

Things we haven't tried or just trying now and which may be helpful:
1.Build a lot of the application as SWCs or anything as an RSL
2.The Hellfire compiler (http://stopcoding.wordpress.com/2008/06/17/hellfire_compiler/)3.Use the Flex 4 SDK (or just the compiler portion) with Flex Builder
4.Merge some of the many Flex 4 compiler performance changes into a Flex 3 SDK, and using this in Flex Builder
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory