Skip to main content

QTP vs Seleium vs Other tools

I had a chance to look at this comparison and do not agree with few claims.
(Not because I am dedicated to selenium but since I have found few of these working my self.)



They are just mentioned as mere Yes or No with out any associated reasoning. I have tried to contradict few of these claims below -

  • Ability to identify objects using multiple parameters: Selenium does indeed support multiple ways for identifying object like - id, name, Xpath, css, dom etc.
  • Ability to run multiple scripts consistantly in a Batch mode: This can be easily achieved using frameworks like JUnit, TestNG etc,
  • Object Oriented Scripting Support: Selenium has a long list of supported client drivers and if Java, C# are not object oriented then which language is object oriented?
  • Integration with External libraries: What are libraries like TestNG, Fest, Ant which I have integrated with Selenium for my test effort
  • Object parametrization: Can be achieved using TestNG
  • Integrated Data Driven Test framework support: Cab be achieved using TestNG
Though these features are supported from external libraries but there is no harm in plugging in external libraries in existing tool and getting the things done.

Popular posts from this blog

Where is my defect ID?

Don't you feel ecstatic when your automated tests find bug? After all tests finding bugs give us a sense of accomplishment, is not it? And this is followed by usual cycle of defect reporting, retesting and hopefully closure of defect. But at times defects are deferred to next or future releases. Which causes test method to fail for subsequent releases. And if you are dealing with a test suite having 100s of tests then it may become difficult to remember if there was a defect reported for a failing test? How do you deal with such situation. How about adding defect-id to @description tag of TestNG test. Hence it is reported on automated test report and we would know if defect exists for a failing test - How do you track defect-id of a failing test?

Return only first or last element from webelements collection

We often come across situation when there are multiple elements on a page and we probably like to exercise only a few of them using selenium webdriver. May be just first and last element. For example on a search result page we may like to click on only first and last link and not all. This is when Iterables API comes handy. (By the way I am assuming that you have already completed watching selenium training videos :)). Once we have collection of web element then we can use Iterables to get only first or last element as following - Consider that we fetch collection of element as - List< WebElement > webElements = getDriver().findElements(By. id ( "htmlID" ));   Now we can get the first web element from this collection as -  WebElement firstElement = Iterables. getFirst (webElements,  getDriver().findElement(By. id ( "defaultElement" )));   Herein second argument -   (getDriver().findElement(By. id ( "defaultElement" )))    in the me

Using chrome console to test xPath and css selectors

Since the advent of selenium there have been many plugin to test xPath / css selectors but you don’t need any of them if you have chrome browser. Using Chrome console you can test both xPath and css selectors. Launch website to be tested in chrome browser and hit F-12 and you would see chrome console opened in lower pane of application - Hit escape key and console would open another pane to write element locators - And now you can start writing xPath or css selectors in chrome console and test them - The syntax for writing css id - $$(“ ”) And hit the enter key. If your expression is right then html snippet of the application element corresponding to the css selector would be displayed - If you mouse over the html snippet in chrome console then it would highlight the corresponding element in application - If you want to clean console of previously written element selectors then just hit ctrl+L keys and chrome console would be empty again. Pro