I'm trying to automate a Java based web application. The application can be accessed using a web browser. Entire application is divided in three frames. The page that I need to automate comes under one of the frames and is a FORM
(having an HTML tag similar to the following tag
FORM NAME="Area|AREA_LM" ACTION="../servlet/UIControlServlet" METHOD="POST">
As forms are not directly supported in the QTP, QTP adds these as a WebElement object. There are a number of generic web element attributes however Name is not one of them. But, in the application under test, in our case, we do not have any other WebElement attribute that can uniquely identify it.
Can anyone suggest solution for this problem?
Patni Computer Systems
I used the Runtime property to retrieve the name value. Don't know whether this is the best way, but works
While spying for the runtime property, QT displays the name property in the list of values, but GetROProperty does not return the value of the name property. Hence used the value of outerHTML property, from which the name can be derived. outerHTML displays as <FORM name="name1".... String functions can be used to find the name.
I have each of the form as different WebElements -- WebElement1, WebElement2,WebElement3
While execution used a for loop to determine the webelement i am interested in.. sample code:
'Replace # with parenthesis
For i = 1 to 3
strOuterHTML = Browser#"Browser"#.Page#"Page"#.WebElement#"WebEle ment" & i#.GetROProperty #"outerHTML"#
posNme = instr#1,strOuterHTML,"name="#+5
lenNme = instr#posNme,strOuterHTML," "# - posNme
strName = mid#strOuterHTML,posNme,lenNme#
If strName = "WHAT I WANT" then 'This is my object