开发者

Selenium, Not able to interact with a specific element in a web Page

开发者 https://www.devze.com 2023-03-23 22:53 出处:网络
Moving my Cursor to a Element in webpage opens a drop down menu but this element is not clickable whenever user moves cursor over this element a dropdown menu opens

Moving my Cursor to a Element in webpage opens a drop down menu but this element is not clickable whenever user moves cursor over this element a dropdown menu opens

Example can be Like in this webpage(Stackoverflow page) when you point your cursor to your user name located at top it opens a drop down menu/window

But using Selenium i 开发者_StackOverflow中文版m not able to replicate this

Using Selenium not able to open this Drop down menu

used click, focus and mouseOver for this but didn't get any success

Please Help


I found the reason for my problem

Actually in my site dropdown operation is defined in CSS and Selenium does not interact with CSS.


Here is how i can select the the "reputation" link from the menu which is displayed when you hover over the triangle next to your name on Stackoverflow.
You must ensure you wait for the menu to be visible before trying to click a link in it.

<tr>
    <td>open</td>
    <td>/questions/6870807/selenium-not-able-to-interact-with-a-specific-element-in-a-web-page</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=span.profile-triangle</td>
    <td></td>
</tr>
<tr>
    <td>waitForElementPresent</td>
    <td>link=reputation</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>link=reputation</td>
    <td></td>
</tr>
0

精彩评论

暂无评论...
验证码 换一张
取 消