testing - 无法滚动导航菜单

标签 testing automation automated-tests e2e-testing testcafe

我使用 Testcafe。 我在点击导航栏底部的元素时遇到问题。


测试网址:https://devexpress.github.io/testcafe/documentation/test-api/

测试代码:

import {Selector} from 'testcafe'

fixture('scroll')

test('Can scroll sidebar', async t => {
    await t
        .navigateTo('https://devexpress.github.io/testcafe/documentation/test-api/')
        .resizeWindow(1280, 600)
        .click(Selector('a').withText('TypeScript Support'))
})

我想要滚动导航栏并单击 TypeScript Support 链接,但滚动的是整个窗口,而不是导航栏。这里有解决方法吗?

最佳答案

导航菜单使用自定义滚动机制,因此自动滚动机制不应该工作。 您应该使用 the drag action 手动滚动到所需的菜单项。 ,例如:.drag('.ps-scrollbar-y', 0, 600)

关于testing - 无法滚动导航菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53575914/

相关文章:

java - 相当于 conserve String 的环境变量

python - 在cmd中将参数传递给.exe文件

java - 如何从全文中选择特定片段?

delphi - 在 TestComplete 脚本中使用 TTabSet

testing - symfony WebTestCase 客户端不发送发布数据

Angular 2 : Replace injected Renderer with jasmine spy object in component shallow tests

angularjs - 使用 Jasmine 测试 AngularJS 资源

automation - 如何自动发送在 Postman 中先前请求中收集的 JWT token

testing - 运行位于不同目录中的两个不同 python 脚本的测试用例

python - 使用 Selenium python 将文件下载到所需文件夹或当前测试目录文件夹中