Skip to main content


Showing posts from March, 2011

Selenium RC with Eclipse

TestNG with Eclipse

ActiveX OLE COM Objects used in Automation

Have listed some of the often used objects while automating using QTP and other tools...

FileSystemObject - File system operationsScripting.Dictionary - Dictionary to store/read values in key-value pairsExcel.Application - Excel applicationWord.Application - Word applicationWscript.Shell - Command promptcdo.message - To send emailAcroExch.PDDoc & AcroExch.App - PDF Access but need to be AdobeAcrobat installed.Microsoft.XMLDOM - To read/parse XML docADODB.Connection & ADODB.RecordSet - To connect/read/write databaseSystem.Collections.ArrayList - To create/read/write array listsInternetExplorer.Application - Internet Explorer browserMicrosoft.XMLHTTP - HTTP to send request/get response

Automation Object Models -QTP:
1. QuickTest.Application
2. QuickTest.TestLibaraies like for every Dialog in UI of QTP application which contains options that we can modify will have a AOM object. We can use that to handle in script dynamically

Welcome all to share objects like these. It will help a lot…

Handling Dialogs in Selenium Automation

According to me Selenium is one of the best open source, free tool for testing web applications. It's quite powerful and gives you the facility to write down your test case in your favorite language ( from the plenty of languages it supports ). But it sucks when it comes to handle the dialogs. Dialog boxes are like ghosts to selenium, It can't even see them.

That's because dialogs are native to the operating system you are running and selenium are designed to identify only web component.

After searching too much on the Internet and other forums, I finally got the solution to all my problems. The solution is too simple. As you can't handle the dialog box through selenium, use the other software to do this. And AutoIT is best at this.

Download Execuable (exe) to Handle Save Dialog of Firefox

Download Execuable (exe) to Handle Save Dialog of Internet Explorer

Download Execuable (exe) to Handle Authentication Dialog


Handling alertBox
AlertBox at Page Load Event


Handling PopupWindows, modal dialogs etc

If your application has a link or a button which opens a new window, and you want to perform some action on the newly opened window though selenium, it's not that hard to handle if you have title, name or the variable associated with that window.

However this is not the case always, sometime you don’t have name of the window or any variable associated with it, and you are not even able able to identify window using title, at the time selenium sucks to identify the window. However there are some alternative ways to resolve this (which might work, not sure). But before we see that let’s see how to select the windows that can be identified easily.

Select window using SelectWindow API
TitleNameVariable Name (variable to which window is assigned)Inbuils APIs to retrieve Windows Names, Titles and IDs
When SelectWindow API fails to Identify Window

Select window using SelectWindow API
Selenium provides the selectWindow API which takes any of the following argument to identify the window.