tags:

views:

22

answers:

1

I'm testing a Java web application on QTP. In one screen, not all fields are visible initially (ie: they're 'below the fold'), so this:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Set "bob"

Causes an unspecified error to occur.

But if I change it slightly, to:

Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Object.SetText "bob"

It works fine. Why?

+1  A: 

If the object Properties for the JavaEdit Box which is set by the Developers is different from other similar objects. hence it has to be done in that way.

There are many instance like where one cell of the Java Table is set by the value using SetCellData for the Edit operation and for a same kind operation usually we use Type / SendKey methods.

TestGeeK
Be warned, however, that doing the Object.SetText sets the text directly on the GUI object. Depending on how your developers handle events, the update might not be handled completely.
TheBlastOne