Forum Discussion
AlexanderM
15 years agoStaff
Hi Oleksiy,
The getElementsByTagName method returns a native enumerator of native objects which cannot be converted to TestComplete wrappers. In case of Firefox, the native objects do not contain the getAttribute method.
As for your additional questions, I recommend that you try using the FindAllChildren method (for additional information, see the "FindAllChildren Method" help topic). Note that the default value of the method's Depth parameter is 1, and this means that the method only examines children of the current object by default (that is why, the method returned nothing in your case, I suppose). If you need to examine 2 or more levels of the objects hierarchy, you need to specify the search depth explicitly. Here is an example script that clicks one of the links contained in the specified object:
[JScript]
function testFF() {
var obj = Sys.Process("firefox").Page("http://www.automatedqa.com/").Form("aspnetForm").Panel(1).Panel(0).Panel(1).Panel(0);
var found = obj.FindAllChildren("tagName", "A", 100); <=== Pay attention to the method's third parameter
found = VBArray(found).toArray();
found[0].Click();
}
Let me know if you have any additional questions.
Related Content
- 4 years agoGunacelan
- 3 years agonewbe
- 2 years agoIlakkk
- 3 years agovargirovic
Recent Discussions
- 8 hours agoMW_Didata