文章分类 -  QTP技巧-XPath相关

摘要:Example 1:Use Button 3 to climb up to its TABLEThis is similar to example we saw in the section 'Select Parent Nodes using Children' but instead of using the XPath expression /..,we will use axes.The target HTML and XPath axis is shown below: "!-- destination --> View ID View Address 阅读全文
posted @ 2013-11-21 12:29 dushuai 阅读(356) 评论(0) 推荐(0)
摘要:AxisNameDescriptionancestorSelect all parent nodes(ancestor: parent,grandparent etc) of the current node.ancestor-or-selfSelect all parent nodes(ancestor: parent,grandparent etc) of the current node and the node itself.attributeContains all attributes of the current node.childContains the childre... 阅读全文
posted @ 2013-11-21 09:36 dushuai 阅读(137) 评论(0) 推荐(0)
摘要:Example 1: View ID View Address View Phone Number In QTP:'Select the PARENT table of Button 6Browser("XPath").WebElement("xpath:=((//INPUT[@value='Button 6'])[1])/../../..").Click 阅读全文
posted @ 2013-11-21 09:11 dushuai 阅读(126) 评论(0) 推荐(0)
摘要:Example 1: John Smith Anne AndersonIn QTP:'Selecting John SmithBrowser("XPath").WebElement("xpath:=//h4[1]").Click'Selecting Anne AndersonBrowser("XPath").WebElement("xpath:==/h4[contains(text(), 'Anne')]").Click)Example 2:XPath:1. (//tr[@class 阅读全文
posted @ 2013-11-21 09:02 dushuai 阅读(1141) 评论(0) 推荐(0)