How to Automate Mouse scrolling event in Selenium IDE

前端 未结 1 498
别那么骄傲
别那么骄傲 2021-01-01 01:30

I am trying to capture/automate mouse scrolling event in selenium IDE. Like in Facebook friend list page, we have to scroll to the end to list all friends.

I want to

相关标签:
1条回答
  • 2021-01-01 01:59

    Selenium RC :

    selenium.getEval("window.scrollBy(x,y)");

    Selenium IDE :

    storeEval  |  selenium.browserbot.getCurrentWindow().scrollTo(x,y)
    

    UPDATED:

    <tr>
        <td>storeEval</td>
        <td>selenium.browserbot.getCurrentWindow().scrollTo(100,800)</td>
        <td></td>
    </tr>
    <tr>
        <td>waitForPageToLoad</td>
        <td></td>
        <td>10000</td>
    </tr>
    <tr>
        <td>storeEval</td>
        <td>selenium.browserbot.getCurrentWindow().scrollTo(200,1600)</td>
        <td></td>
    </tr>
    <tr>
        <td>waitForPageToLoad</td>
        <td></td>
        <td>10000</td>
    </tr>
    <tr>
        <td>storeEval</td>
        <td>selenium.browserbot.getCurrentWindow().scrollTo(300,2400)</td>
        <td></td>
    </tr>
    

    This will scroll the window to 3 different coordinates.

    0 讨论(0)
提交回复
热议问题