文章分类 - QTP技巧-DOM相关
摘要:适合HTML DOM的原因: 1.QTP only provides access to radio buttons through the WebRadioGroup rather than providing access to individual elements. 2.QTP provides no way to access webpage style sheets to find out any CSS inplemented for it 3.Normal QTP operations are not equipped to accomplish tasks.Exampl...
阅读全文
摘要:'1.WebEdit:'HTML源代码样例:'<INPUT type="text" value="QuickTest" id="ID_001" name="NAME_001">'QTP中代码样例:'操作方式1:'获取DOM对象set oDocument = Browser("Browser").Page("Page").Object'使用GetElementByID获取对象元素,并更改文本框WebEdit的v
阅读全文
摘要:'等待页面加载:'使用IE COM启动IESet oIE = CreateObject("InternetExplorer.Application")oIE.Visible = True '设置可见oIE.Navigate "http://www.baidu.com" '跳转URL'等待IE页面加载完毕While oIE.Busy: Wend'利用DOM操作测试对象'(1)通过getElementByID方法获取定位对象,并对其进行操作:'使用IE COM启动IEoIE.Visible =
阅读全文
摘要:Cnt = Browser("").Page("").object.links.lengthOrCnt = Browser("").Page("").object.getElementsByTagName("A").length
阅读全文
摘要:oDocument.parentWindow.execScript "function sum(x,y) {return x+y;}"Msgbox oDocument.parentWindow.Sum(2,3)
阅读全文
摘要:cellContent = oTable.Rows(iRow - 1).Cells(iCol - 1).outerText
阅读全文
摘要:Dim oParentSet oParent = oNodeDoSet oParent = oParent.parentNodeLoop While oParent.tagName <> "TABLE"
阅读全文
摘要:All will return the collection of object matching the name or id in such case.So if there are two objects with the name as "test" and one object with id as "test" then all would return 3 objects.
阅读全文

浙公网安备 33010602011771号