摘要: Example 1: John SmithJohn Smith is within the H4 tag. Its TEXT value is used to implement Object Indentification in this example. Below is the target HTML used: John Smith CSS:1. h4[innertext~='John']Note: This Selector works in IE, not Firefox.2. h4:first-of-type3. h4[innertext*='John&# 阅读全文
posted @ 2013-11-21 21:47 dushuai 阅读(270) 评论(0) 推荐(0) 编辑
摘要: To understand how CSS Selectors work, let's use the following web page as an example: CSS John Smith View ID View Address View Phone Number Anne Anderson View ID ... 阅读全文
posted @ 2013-11-21 20:05 dushuai 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(340) 评论(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 阅读(134) 评论(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 阅读(124) 评论(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 阅读(1138) 评论(0) 推荐(0) 编辑