Revision 583 (by dhwang, 2007/08/28 16:03:07) GITAK 0.8 V8 again
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
Copyright 2004 ThoughtWorks, Inc

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<html>
<head>
    <meta content="text/html; charset=ISO-8859-1"
          http-equiv="content-type">
        <title>Test XPath Locators</title>
<script language="JavaScript" type="text/javascript" src="../core/scripts/selenium-browserdetect.js"></script>
    <script language="JavaScript" type="text/javascript" src="../tests/filter-tests-for-browser.js"></script>


</head>

<body>
<table cellpadding="1" cellspacing="1" border="1">
    <tbody>
        <tr>
            <td rowspan="1" colspan="3">Test XPath Locators<br>
            </td>
        </tr>

        <tr>
            <td>open</td>
            <td>../tests/html/test_locators.html</td>
            <td>&nbsp;</td>
        </tr>

        <tr>
            <td>verifyText</td>
            <td>xpath=//a</td>
            <td>this is the first element</td>
        </tr>
        <tr>
            <td>verifyText</td>
            <td>xpath=//a[@class='a2']</td>
            <td>this is the second element</td>
        </tr>
        <tr>
            <td>verifyText</td>
            <td>xpath=//*[@class='a2']</td>
            <td>this is the second element</td>
        </tr>
        <tr>
            <td>verifyText</td>
            <td>xpath=//a[2]</td>
            <td>this is the second element</td>
        </tr>
        <tr>
            <td>verifyElementNotPresent</td>
            <td>xpath=//a[@href='foo']</td>
            <td></td>
        </tr>
        <tr>
            <td>verifyAttribute</td>
            <td>xpath=//a[contains(@href,'#id1')]/@class</td>
            <td>a1</td>
        </tr>
        
    </tbody>
</table>
<p>SEL-165: search for text w/ and w/out nbsp: "this is the&amp;nbsp;second element" and "this is the second element"</p>

<table cellpadding="1" cellspacing="1" border="1">
    <tbody>

        <tr>
            <td>verifyElementPresent</td>
            <td>xpath=//a[text()="this is the&nbsp;second element"]</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>verifyElementPresent</td>
            <td>xpath=//a[text()="this is the second element"]</td>
            <td>&nbsp;</td>
        </tr>

    </tbody>
</table>
<table cellpadding="1" cellspacing="1" border="1">
    <tbody>

        <tr>
            <td>verifyText</td>
            <td>//a</td>
            <td>this is the first element</td>
        </tr>
        <tr>
            <td>verifyAttribute</td>
            <td>//a[contains(@href,'#id1')]/@class</td>
            <td>a1</td>
        </tr>


        <tr>
            <td>verifyText</td>
            <td>xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td</td>
            <td>theCellText</td>
        </tr>

        <tr>
            <td>click</td>
            <td>//input[@name='name2' and @value='yes']</td>
            <td>&nbsp;</td>
        </tr>

        <tr><td colspan="3"><i>test for SEL-242</i></td></tr>

        <tr>
            <td>verifyElementPresent</td>
            <td>xpath=//*[text()="right"]</td>
            <td>&nbsp;</td>
        </tr>

    </tbody>
</table>
</body>
</html>