コードは CSS を使用してボタンに焦点を合わせて強調表示しますが、プログラミング言語として c# を使用して Selenium RC で CSS を使用してボタンをクリックすることはできません。これが私のコードです。
if(selenium.IsElementPresent("css=button[id$=searchButton]")) //finds the button
{
selenium.Focus("css=button[id$=searchButton]"); // focuses the button
selenium.Highlight("css=button[id$=searchButton]"); //highlights the button
selenium.Click("css=button[id$=searchButton]"); //doesn't click the button???
}
以下の Xpath コードは、C# を使用した Selenium RC で問題なく動作します。
selenium.Click("xpath=//button[matches(@id,'.*searchButton')]"); //works fine with this xpath code
ボタンの HTML コードは次のとおりです。
<td align="left" style= "vertical-align : top;">
<button type="button" class="ClassButton" id="genId_38_:mainPanel_genId_39:searchButton" tabindex="0">
Click Me</button>
</td>
少しでも助けていただければ幸いです。