0

JI は Web サイトのテストに Selenium を使い始めたところです。ただし、リンクと xpath の両方を使用して見つけることができないボタンがウェブサイトにあります。URL はhttp://hra.case.edu/infoです。名の入力ボックスに「John のように」と入力すると、Web サイトは、あなたが可能なユーザーを示す表を表示します。そして、最初のボタン「This is me」をクリックする必要があります。

Seleniumのテストケースのソースコードは次のとおりです

<tr>
    <td>open</td>
    <td>/</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>link=Get Started</td>
    <td></td>
</tr>

<tr>
    <td>keyPress</td>
    <td>name=searchFirstName</td>
    <td>John</td>
</tr>
<tr>
    <td>selectWindow</td>
    <td>name={&quot;$&quot;:{&quot;memLimit&quot;:2000,<br />&quot;autoFlush&quot;:true,<br />&quot;crossDomain&quot;:false,<br />&quot;includeProtos&quot;:false,<br />&quot;includeFunctions&quot;:false,<br />&quot;currentDomain&quot;:&quot;case.edu&quot;}}</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>//*[@id='select_user']/tr[1]/td[1]/a</td>
</tr>

It fails at the last step said [error] Element Xpath//*[@id'select_user']/tr[1]/td[1]/a not found

そのボタンの場所を知っている人はいますか?ありがとう!ps firebugコンソールを使用してそのボタンを見つけることができます

>>> $x(".//*[@id='select_user']/tr[1]/td[1]/a")
[a.btn /midlife/149]
4

2 に答える 2

0

そんな風に待つだけでいいなんて

command-waitForElementPresent

target-Xpath//*[@id'select_user']/tr[1]/td[1]/a

于 2013-10-11T09:44:41.423 に答える
-1

以下のxpathで試してください

"//div[@id='content']//tbody[@id='select_user']/tr[1]//a"
于 2013-09-23T17:56:42.647 に答える