UFT is not working properly with web objects on Firefox... (525 Views)
Reply
Collector
TiagoSoares
Posts: 1
Registered: ‎01-30-2014
Message 1 of 1 (525 Views)

UFT is not working properly with web objects on Firefox...

First of all, let's take a look on the version of the programs:

 

UFT: 11.53 build 0382 (Installed the UFT_000444)

Internet Explorer: 10.0.9200.16750

Firefox: 24.2.0

 

The problem: On IE we don't have any issue when we are working with web objects recognition and operation. On Firefox, we can recoginze the objects and operate until certain point.

 

Follow a script sample and the description of the problem.

'-------------------------------------------------------------------------

'Before run this script, open the browser on this url: http://www.w3schools.com/html/html_tables.asp

Call TestBrowser(1,"Right")
MsgBox "TEST FINISHED!"

ExitTest

Sub TestBrowser(ColumnIndex,ExpectedAlignement)
Dim x

Dim strTextResult, strAlignment

Dim theTableObject, theCellRow
Dim theCell
Dim theCellStyle

strTextResult = ""

'Captured the object via XPath in order to make the execution independent of the browser


Set objTable = Browser("Title:=.*").Page("Title:=.*").WebTable("xpath:=//h2[text()='HTML Table Example:']/../table[@cellpadding=3]")

 

If not objTable.Exist(0) Then
msgbox "Object doesn't exist."
else

intRowsNumber = objTable.RowCount

For x=0 To intRowsNumber -1

Set theTableObject=objTable.Object

'On Firefox the following error occurs on this line below: TypeError: obj[GetCaseInsensitiveName(...)].apply is not a function
Set theCellRow=theTableObject.rows(x)

Set theCell=theCellRow.Cells(ColumnIndex)
Set theCellStyle = theCell.currentStyle

strAlignment = theCellStyle.textAlign ''Get the align property of every cell

If UCASE(strAlignment) <> UCASE(strAlign)Then
strTextResult = strTextResult & "Row: " & x & ". Column: " & ColumnIndex & ". Expected: " & ExpectedAlignement & ". Found: " & strAlignment & ". " & vbcrlf
End If

Next

If strTextResult<>"" Then
msgbox strTextResult
End If
End If
End Sub

'-------------------------------------------------------------------------

 

So, basically, the Object method is not working on Firefox. I would like to know if anybody has an alternative to this in order to get the same script working on both browsers.

 

Thank you very much in advance!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.