Blog Home »

Is your Web-App Selenium-Test Compatible?

July 13th, 2009 admin Posted in Open Source tools 14 Comments »

By Pallavi Sharma

If you are trying to automate your web application using selenium, a few things which you should know before you start the quest. For most of the selenium commands a “target” is required which is laymen terms is the object in your web-application on which you wish to perform a desired action.

Selenium follows a location strategy to locate the element in your application which consists of four modes:

1. Locating by Identifier.

2. Locating by XPath/CSS

3. Locating by DOM

4. Location by CSS

You will find detail description of the above locating techniques on the selenium website which are explained well there [http://seleniumhq.org/]. But what not is explained is when to use what and the negatives of each locating strategy.

1. Locating by Identifier: To locate an element using an identifier means that the element must have either an “ID” attribute or “NAME” attribute which should be unique on that page. You may use “type” or “index” property in combination with these identifiers to help selenium uniquely identify the element.

Selenium is right in expecting that if will find an element uniquely by locating using an identifier. The W3-standards also states that the “ID” attribute has to be provided for all elements and it should be unique. But since the HTML has no inherent check on such slip-ups, most of the developers end up doing so in their web applications while developing forgetting that it has to undergo testing also.

So if you know before hand that “Selenium” is the automation tool which suits your web application scenario the best; ensure your developers haven’t made such mistakes.

2. Locating by XPath: To locate an element using an Xpath, is not a very straightforward solution but it helps immensely when you have to use multiple attributes to help locating an element. Xpath is a powerful way of using any attribute by which you would want the tool to find the element and perform action on it. It is useful mostly in the cases when the developers have used same name, ids across the website and didn’t cared for the W3-standards.

But if you can expect your developers to overlook W3 standards for unique IDs you may very well expect them to give you “unclosed” tags in your application! And if your web application has even a single unclosed tag, Selenium won’t be able to detect the element using the “XPath”.

So if the above is the locating method, you expect to find an element ensure you don’t have unclosed tags in the application.

3. Locating by DOM: The last resort to find an element and weakest one to. It is not advisable to use especially if your website undergoes too many changes. And also if the intention of testing your web site is functional/regression.

4. Locating by CSS: If for initial thoughts you are thinking that what if my web-app doesn’t have CSS will this work, then the answer is “Yes”. This locator type works whether you have CSS or don’t have CSS. It is faster than X-Path, and as stated on the Selenium website, experience users like to use the CSS way of locating an element. This also doesn’t works if the DOM is broken, and also is browser depended, as different browsers have different way of handling CSS.

To summarize the above, it is vital to do a W3 standard check on your website so that you can throw all issues back at your developers to fix, before you jump in to testing your website using Selenium. A good starting point is the, W3-validator [http://validator.w3.org/] available freely online. It clearly list down the issues like duplicate ids, unclosed tags and other slip-ups. Selenium is a powerful tool to use to test your web application across operating systems and browsers but if the DOM is broken than none of the locators will work, coz selenium using the browsers java script engine so the results will also depend on which browser you are using for the test.

It is not mentioned clearly on the website www.seleniumhq.org when to use what locator strategy, and it is kind of overwhelming information why they have provided all such locator categories to the users? Couldn’t there have been a simpler and straight forward way of handling elements using just a single locator type which works under any circumstance. I don’t know the answer to this yet, but maybe will have….

Till the next blog happy testing your sites with Selenium.

AddThis Social Bookmark Button

Test Management In HP Quality Center 10.0

July 2nd, 2009 admin Posted in Other Commercial Tools 2 Comments »

By Sandhya Sapru

The Quality Center 10.0 was launched on 14th January 2009 and came into the market finally from Jan 30th, 2009

The new Version 10 is an absolute milestone not only for tests managers. It also makes life easier for Testers, for R&D persons, Test Managers, as well as QC System administrators. The new functions have been anticipated for quite some time and have been implemented in the new product in a well-conceived manner.

•    Editions Of QC 10.0

1.    QC Starter Edition: This Edition is for small teams , managing small teams.

2.    QC Enterprise: Targeted at Mainstream QA Organization that are involved in managing medium to large Releases and are having new capabilities.

3.    QC Premier Edition: Mainly for Large and mature Organization who have either or implemented COE (Center Of Excellence) in their Organization and who are managing enterprise releases.

•    Versioning:-
Initially there were change related problems that the QA people had to face like
1. Frequent changes in Requirements and tests…
2. Repeated copying of Project related assets leads to chaos.
3. There is lack of visibility when priorities change.
For that matter Versioning concept has been introduced in QC 10.0 to improve the chaos, improve the change related problems to Requirements, Tests and Components.
In this manner, the people involved will have latest information related to the Project and there is no need to purchase third party version tools as well as data integrity can be maintained across projects.

•    Baselining:
Capture project related information or assets at key point of time to make it clear what was agreed to and what was delivered. If any problem happens at any particular version of the project baselining helps   you to go to the previous version or rollbacks to previous version of the project assets and also helps in to sign off when a particular milestone is reached.

•    Integrated Dashboard :
Initially in previous version of Quality Center the Dashboard has to be installed separately. It had separate database, complex and hard to use.

Quality Center 10.0 includes a role based Dashboard which enables a QA Manager, R&D Manager, Business analyst and Team Lead to create their personalized Dashboard. This Dashboard is for a single project and replaces the dashboard of previous versions. It is now finally possible, when working on a QC project, to get an overview of all of one’s ongoing projects. These dashboards are freely configurable and can be designated to be personal favorites or publicly accessible. Special Excel reports also enable direct access to the database via SQL. The generated reports can then be graphically processed at the same time by means of VBScript
Helps in Real time progress and status reporting with focus on individual stakeholders in effective release decisions and there is no need to manage Servers.
No linkage between legacy Dashboard and new Dashboard of QC 10.0.

•    Enhanced Risk Based Quality Management with Testing effort:

The QC 10.0 has a strategic test plan that helps to identify the Testing Effort of a particular Requirement of a particular Business Risk. This helps to accurately plan the project deliverables and how much testing effort should be put on Requirement of a particular level.

•    Shared Libraries or Library Management: Sharing tests , requirements and components:– With QC 10.0 a Shared Library can be created for requirements , Tests and Components, can be re-used and distributed

A library represents a collection of entities in a QC project, including their relationships to each other. When dealing with many similar projects, it offers the advantage of not having to repeatedly create entities. Libraries can be imported from project A into project B, compared against each other, or even synchronized. A library also allows one to collect the same entities as in versioning. With Quality Center Premier Edition, Defects are not included, but they can be shared with the new “HP Quality Center Synchronizer” manually among several QC projects.

•    Cross Project Customization

Many organizations have defined standards, such as a uniform defect status field or a standardized priority scale, for their software quality-related areas. However, these fields and lists were often changed or even deleted by QC project administrators. Some companies have even gone to great lengths in using their own programming to define a template that can be distributed to all QC projects, thereby establishing a uniform standard.

Site Administrator now provides a way to link projects with a template. If the template is changed, the data can then be passed on later at the right point in time. This function has been awaited not only by test managers who like to have the same configuration in all their projects, but especially also by the respective operators of QC installations, namely the system administrators. Cross Project Customization is also only available in the Premier Edition.

AddThis Social Bookmark Button

Updates about QTP 10 (II)

May 20th, 2009 admin Posted in Quick Test Professional, Uncategorized 3 Comments »

By Roshi Malhotra

(Continued from Updates about QTP 10 (I) … )

II. Report improvements

The native QTP report includes several new improvements:

Tracability: Selecting a report-node will automatically focus on the relevant code-line in the script. This may sound like a cool feature at first, but a closer look revels that it only works for actions (not functions); and that in any case, using a custom report function (as most of us do) completely nullifies the feature (since you’re always at the same code line when performing the report).

Exporting: The report now has a two-click export feature, which comes with a built-in ability to export to Word and PDF documents, as well as the ability to export through a custom XSL of your choosing. You can choose between Short and Long formats (corresponding to PShort.XSL and PDetails.XSL) to get a document relevant to your needs. This blessed feature has one major flaw – It has no API support. This means that you cannot export the results automatically at the end of a test run, which is quite a miss, to say the least.

Resource Monitor: QTP can now hook onto the Windows Performance Monitor and present it as part of the test results. You can select several counters to monitor (e.g. GDI objects, memory usage etc.), and the monitor output graph will be available in special tab in the result window. You can set up a “checkpoint” for a counter (e.g. Fail the test if there are more than 500 GDI objects), facilitating a kind of a poor-man’s version of load-testing.

The fact that clicking the graph focuses on the relevant test step (as well as the other way around), provides an effective way to quickly locate problematic actions and resource usage spikes. This feature is well executed, and HP has even went the extra mile and added several unified counters that simplify monitoring the application. However, the fact that you can only monitor one process per test may leave the more advanced users with their own implementation of a resource monitor. 

Native image integration: This is a small, yet long-awaited feature. The ReportEvent command now has a new optional parameter – you can specify a path to a picture file, and it will be attached to the report node of the current event. When used in conjunction with the CaptureBitmap method, this presents a technical, yet revolutionary upgrade to the native QTP report. Finally, users can attach screenshots to their custom report events without any special functions or frameworks.

III. IDE improvements

Intellisense: IDE improvements, and the new intellisense engine in particular, is what got me excited about QTP Atlantis. 

Can create an Excel COM object provided a full intellisense for all its methods and properties, for as many levels as we’d like. Every variable set to this object also presented the same intellisense, and the autocomplete caught every variable we’ve defined or used (yes, there’s autocomplete for variable names!). The autocomplete and intellisense features worked smoothly, and presented no apparent performance issue. It’s still left to be seen how it functions in a real script, with hundreds / thousands code lines.

Tasks and Comment Pane: QTP has a new bottom pane which includes a run-of-the-mill implementation of tasks and comments. Double clicking a comment will take you to the relevant code-line, though strangely enough, you cannot do this with a task (i.e., tasks cannot be linked to specific code lines). It was mentioned that enabling the comments feature for function libraries may sometimes cause performance issues.

Dynamic code-zones: When standing inside a code block like If, While, Do, etc, the IDE will mark the relevant block with blue lines, making it much more easy to make your way inside nested blocks of this sort (somewhat like highlighting left-right bracket pairs). While it will surely make our life easier, a more robust mechanism like collapsible code-regions is still needed.

Custom Toolbars: You can add your own buttons and commands to QTP toolbars and menus. While this does not include inner-QTP macros, you can assign a program / File shortcut to your own button / menu item. It’s nice, but i think it will only gain power once QTP’s inner mechanisms will be bindable to such buttons.

IV. Miscellaneous features

General look and feel: QTP has departed from the old Tab layout, and into the more modern settings-tree layout (similar to Office, EMule, Adobe, and pretty much every other program). It’s nice, but nothing as groundbreaking as the transformation in QTP 9.0.

Bitmap Checkpoint improvements: These include presenting the size of the selected area when choosing to check only a part of an Image, as well as the ability to plug your own custom DLL for comparing images. Another great addition is the ability to see the difference between the expected and actual bitmaps in a separate tab.

API changes: QTP Automation API will receive several upgrades, the most noteworthy of which is the ability to read and write that code of the test you’ve opened. Writing the code will not effect an ongoing run-session (there goes my ambitious try-catch implementation for QTP), but it still opens the door for some creative tweaks and hacks…

Saving a test with all linked resources: For those who’re working with QC, this is a real blessing. Up until QTP 10, copying a QC saved test to your local system was a hellish procedure of changing each and every resource and action reference to your local file-system. QTP and QC Atlantis offer a one-click solution for copying a test and all its resources to your local file-system, and automatically changing all the references accordingly.

Dynamic Action Call: I’ve saved the best for last. QTP 10 presents a new native command – LoadAndRunAction. It allows you to load external actions during the run-session, without having to associate them with your test beforehand. All the run-time debug abilities will be available for these dynamically added actions, so you’re not giving anything up by using this feature. I think it’s a long awaited feature, and a well executed one.

AddThis Social Bookmark Button

Updates about QTP 10 (I)

May 15th, 2009 admin Posted in Quick Test Professional 3 Comments »

By Roshi Malhotra

QTP 10 revolves around 3 pivotal features, alongside several minor features (which turned out to be quite revolutionary):

I. QC integration – which (mostly) boils down to Resource Management and Source Control:

Resource Management: Although you could keep saving your resources as attachments (for backward compatibility), you can upgrade to a new, fuller mode of work. This includes a whole new Resource module in QC, and allows for some very neat tricks on Function Libraries, Tests, Object Repositories etc.

It should be noted, though, that other types of files (external excel / XML files, for example), remain as unmanaged attachments.

1. Resources have full meta-data, and have a special view pane – you can view Object-Repositories, data-tables, and function libraries code right from QC.

2. Resources are aware of their dependencies – Who relies on them, and who do they rely on. This enables a very strong warning system – when changing / deleting a resource, you’ll be alerted to the repercussions – namely, which tests, if any, might break. Also, the ability to immediately know who uses a share object repository is very useful, nearly revolutionary.

3. A very neat trick is a live, automatically updated path system – When moving a function library between folders, QC will automatically update all the tests which depend on it, so they will use it at its new location. This makes the once critical problem of hard-path-link a non-issue. Very impressive.

4. A word about the user interface – when opening a QC resource / test from QTP, the file dialog shows the items with large, crisp icons, very similar to Word’s save dialog. Everything is very clear and intuitive, as is the ability to revert back to saving / opening a test from the File-System.

5. And what about your existing projects? Well, when upgrading to QC 10, a wizard will automatically transform all you unmanaged attachments to managed resources (if you’d like it to).

Source Control: This includes a very rich line of features which are very well executed, and effectively allow you to manage a QTP project as any other code project:

1. First, the basics – QTP and QC 10 introduce a new Check-in/Check-out ability. It works similar to what you’d expect – a checked out item will be locked to all other users, and you can immediately know an item’s status by looking at its icon (green/red locks).

2. An interesting twist regards manner in which a test / resource is locked – it’s at the user level (not the local machine level). This means that if you log into QC from a different machine, you’ll have access to all your checked-out items, even if they were originally checked-out on a different local machine. The ability is implemented very well, both from QTP’s end, as well as from QC’s end.

A major enabler for source control is the new versioning feature of QC. It manifests both with a kind of instant versioning for a single resource, and with a project-wide “base-line version”, which allows you to revert your entire test framework to a previous version. Both types of versioning are supported by a surprisingly robust comparison mechanism. You can select two versions of a resource / test, a see a very detailed comparison of their respective changes. For function libraries this amounts to a “simple” text comparison, but this feature truly shines in full test comparisons.

It will present changes in the different actions and their resources (data-table, object repositories, inner code), as well as in the global test-settings, associated function libraries, recovery scenarios, and pretty much anything you could think of. The ability to drill-down into the data is very impressive; and the effective, concise manner in which the data is presented in the top level view is downright unbelievable. A nice touch is a small screen capture of the change, in case you don’t remember what “Run all rows –>Changed into-> Run a single iteration only” means (for example).

Now to the versioning mechanism itself: Whenever you check and item in, a new “version” will be created, and you’ll be able to revert back to it with ease. The snapshots are visible both from QC and QTP, and you can very easily choose which one to open. This allows you a kind of an instant undo to a single file which worked in the past, but is broken in the present.

The second mechanism presents the ability to select several folders, and create a full blown “base-line version” of them and everything they relate to. Defects, inner-connections, tests, history data, resources – all these and more will be “frozen” and preserved as a base-line. You can then choose to revert back to an old baseline, and truly regain all the abilities that were present at that time. As all the resources, attachments tests and reports will be restored, you don’t have to worry about forgetting anything, or leaving some minor resource at the wrong version. This is versioning with a vengeance – it allows you to track the AUT’s versions with your own automation versions, enabling, among other things, running automation efforts on several AUT versions at once.

For conclusion – The new abilities inherit in the connection of QTP and QC Atlantis are (or at least seem to be) revolutionary. At last, QTP projects can be natively managed as code projects; and some of the supporting infrastructure is surprisingly robust and useful.

(to be continued…)

AddThis Social Bookmark Button

Bridging the Gap between Open Source & Commercial Tools

April 28th, 2009 admin Posted in Open Source tools, Other Commercial Tools 4 Comments »

By Rajat Singhal

These opinions are strictly my own based on my own observations and experiences with both kinds of software and trying to understand the dynamics at play in each environment. I’m sure others share similar opinions. Also note that these are sweeping generalities and caricatures, but I think provide a good starting model for critiquing both.
The main Gap between Open Source and commercial tools is licensing. Using the Open Source Edition (under the GPL license) obligates you to share your source code without restrictions with the users of your program. Using the GPL also means you may not demand compensation for or limit subsequent re-use and re-distribution of the source code. You need the commercial license if you want to avoid these obligations.

Open source Functional Tools

The reason many users originally try an open source solution (myself included) is price. An open source functional tool will be significantly cheaper than a commercial functional tool. As with many open source programs, because the code is “open,” the opportunities for customization are also greater than they are for a commercial functional tool. Depending on your functional tool needs, there may very well be an existing open source functional tool that will fulfill your requirements.

The arguments against implementing an open source functional tool are numerous, but are generally tied into one key concern: uncertainty. Product support, documentation, and user training are often subject to the whims of volunteer (read: unaccountable) developers. As a result, there is often no brand name or customer service department to offer assurances or assistance in maintaining functional tool stability and security. Enterprise-level workflow management may therefore be difficult to achieve, and product implementation may take considerably longer than with comparable commercial functional tool products.

Commercial Functional Tools

Buying a commercial functional tool offers a number of distinct advantages, not the least of which is commercial support and well-defined service level agreements. A commercial functional tool may already be ready-built for your needs and will likely be faster to implement than an open source functional tool. Documentation and training for commercial functional tool products are usually significantly stronger than for an open source solution. Your average person also associates a certain degree of safety with commercial software as opposed to open source. If you or your client has the resources to purchase and appropriately license a tool, it can often be the safest bet.

Arguments against buying a commercial functional tool come down to one issue: cost. Commercial functional tool license costs can be prohibitively expensive, and customization/integration expenses can send these prices even higher. Commercial functional tools rarely represent a “budget” solution.

On top of that commercial software needs to demonstrate that they have solved a hard problem that no one else has solved or make competitors solutions to problems seem hackish. So the marketing folks will use words like “You want to solve the problem the right way, don’t you?” which often means “The hard way that only we know how to do.” A corollary to that is if a problem is really hard and you have solved it or can convince people you have solved it, make sure everyone knows that and make sure everyone thinks they have the same problem. That actually holds true for both commercial and open source but is generally easier to pull off for commercial software.

Comparison Parameters

Tools => Record and Play Back => Language support => Application support
Watir => Support with WET => Ruby => Web Based Application
Sahi => Inherently Supported => JavaScript => Web Based Application
AutoIT => Inherently Supported => BASIC-like syntax => Windows Application
QTP => Supported => VB Script,Java script => Windows/Web Application
RFT => Supported => Java,HTML,VB.NET => Windows/Web Application

After Thoughts

In the end, I would just like to say that it’s a trade off between how uncertain is the uncertainty of a free Open Source solution with how costly is the cost of a commercial reliable solution. Many companies are trying to bridge the gap between the two by providing software with the reliability and user friendliness of a commercial solution for an open source tool price. Well my team is also working on the same, so keep looking out for my blog people if you are someone needing that Bridge ….

AddThis Social Bookmark Button


Home   |   About Us  |   QA Library   |   Learning Center   |   FAQs   |   Career Center  |   Link Exchange   |   Contact Us
Copyright © QACampus.com. All Rights Reserved.
Powered By : codeplatter
Vision / Mission CresTech Connection Management Team
QACampus Courses ClassRoom Training Live Projects E-courses
Blog Forum QA Library
Career Center Hot Job Upload Resume