I'm trying to run our automation, written for IE, on Firefox 3.6 and facing those frustrating problem: I have a code:
Set cellDataItems = Browser().Page().WebElement().Object.getElementsByTagName("div")
For i = 0 to cellDataItems.length -1
MsgBox (cellDataItems.item(i).innerHTML)
Next
When script goes to line with MsgBox if stops with error:
TypeError: obj[FuncName] is undefined
Then I press debug, see that i=0. I added cellDataItems.item(i).innerHTML into debug viewer, it shows it's value (see below) without errors. Also, cellDataItems.item(i).textContent shows fine in Debug Viewer.
The value of cellDataItems.item(i).innerHTML when i=0 is:
<table class="x-grid3-row-table" style="width: 100px;" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="x-grid3-col x-grid3-cell x-grid3-td-0 x-grid3-cell-first " style="width: 98px; text-align: left;" tabindex="0"><div class="x-grid3-cell-inner x-grid3-col-0" unselectable="on"><div align="left">AUD/USD</div></div></td></tr></tbody></table>
So, why script fails with that error, but debug viewer shows it? Thank you!
Update In Firefox's Console I see more details:
Error: obj[FuncName] is undefined Source File: file:///C:/Program%20Files/HP/QuickTest%20Professional/Bin/Mozilla/Common/components/ScriptWrapperXPCOM.js -> file:///c:/program%20files/hp/quicktest%20professional/bin/JSFiles/mzDotObj.js Line: 76
update 2:
MsgBox (eval(cellDataItems.item(i).innerHTML))
When I use eval - it works! Maybe is there a some way do debug code of QTP's extension for firefox?
update 3: How is that possible: expression "colItem.className" has value "x-panel", but after I execute expression
sClassName = colItem.className
the value of sClassName is Empty:
This works: sClassName = eval("colItem.className")
How this even possible?!!!!!! Or I'm getting crazy, or QTP 11 has a biiig defect inside!