QTP Patches

Recently I had to work with version 11 of QTP. I ran into problems that I was not able to identify objects in Internet Explorer 8.
First thing I thought is, why IE8? But is was something the whole company still used. Although some people used the standalone version of Firefox.
Back to the problem. After searching the web i found the following link: http://sumitkumarshrivastava.blogspot.se/2012/10/qtp-11-error-not-able-to-identify-ie8.html.
Unfortunatly it was not possible to download the needed updates/patches directly. No username and password where available at that time. To solve this I used this: http://para.ms/index.php/locator/search/hpp/QTPWEB_00078 . At the end you place the patch that you want and open it in a browser. It does not work for all patches, but I was able to get the important ones and continue working with QTP 11.

Selenium and changing elements

My application under test has a very nice feature. When a page loads, 3 listboxes are shown and at least 4 input fields. When the last lisbox is changed, it triggers some code. The remaining input fields are changed to listboxes. Ofcourse these new Listboxes have the same ID as the Input fields.

The first problem I encouterd is what happens exactly. With Selenium I got several error messages that did not give me a clue of what had happened. There was a message that the specified field was an Input instead of a Select. Another was that the element was not available any more.

I tried to solve it by trying to wait for the select element, but that didn’t work because the Input field had the same ID as the Select. The name property was not filled in. Then I added a check if the specified field was of the class Select. At first it did not work, but after seperating them it did. Below is the code:

int a = 0;
while(a == 0) {
if(driver.findElement( By.id(tfTemp.getID()) ).getTagName().equalsIgnoreCase("select")) {
a = 1;

while(ExpectedConditions.presenceOfElementLocated( By.id(tfTemp.getID()) ) == null ) {

For now this works, but if you have a better idea, please do not hesitate to contact me. Also I have only tested this with Internet Explorer 10.

After thinking this over (again), I changed the order. First wait until you find a SELECT, then wait if it is visible.

Selenium and changing elements

Settings for FireFox

For me several settings have to be done after a fresh installation of FireFox.

When searching, display the result in another tab: The value of browser.search.openintab must be set to true.

For safety reasons, block referer headers: The value of network.http.sendRefererHeader must be set to 0. (Link)

When you do not want websites to know where you are: The value of geo.enabled must be set to false. (Link)

Install AddBlock. (Link)

Settings for FireFox

Exception in thread “main” java.lang.ClassFormatError: Invalid pc in LineNumberTable in

Today I got the error message above. Searching on google was not very helpfull. Several options that were mentioned:

  • Use an older version of the JDK (for example from 1.7 to 1.6.
  • Use the command javap to decompile and see what the JVM does

None of these had success. So removed the changes I made. In my case I had added a method with a switch-statement. When I removed this and changed it to a regular if-then-else everything worked fine.

My suggestion when you receive this, undo all your changes and try a different approach. I hope it helps!

Exception in thread “main” java.lang.ClassFormatError: Invalid pc in LineNumberTable in