{"id":15170642,"url":"https://github.com/lambdatest/mocha-js-scroll","last_synced_at":"2026-02-24T09:34:32.928Z","repository":{"id":97545262,"uuid":"504184036","full_name":"LambdaTest/Mocha-js-scroll","owner":"LambdaTest","description":"How to scroll webpage in automation test in Mocha-js on LambdaTest","archived":false,"fork":false,"pushed_at":"2022-06-16T14:18:58.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-17T01:37:38.363Z","etag":null,"topics":["lambdatest","mochajs","selenium-webdriver","testing"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LambdaTest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T14:18:40.000Z","updated_at":"2022-06-23T11:16:58.000Z","dependencies_parsed_at":"2023-03-13T16:11:12.055Z","dependency_job_id":null,"html_url":"https://github.com/LambdaTest/Mocha-js-scroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FMocha-js-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FMocha-js-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FMocha-js-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FMocha-js-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LambdaTest","download_url":"https://codeload.github.com/LambdaTest/Mocha-js-scroll/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239221266,"owners_count":19602378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lambdatest","mochajs","selenium-webdriver","testing"],"created_at":"2024-09-27T08:20:29.547Z","updated_at":"2026-02-24T09:34:32.892Z","avatar_url":"https://github.com/LambdaTest.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to scroll webpage in automation test in Mocha-js on [LambdaTest](https://www.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll)\n\nIf you want to test scrolling of a webpage using an automation test in Mocha-js on LambdaTest, you can use the follwing steps. You can refer to sample test repo [here](https://github.com/LambdaTest/Mocha-selenium-sample).\n\n# Steps\n\n## Scrolling to bottom of the page\n\nTo scroll down by x (in this case `350`) pixels, you can use the following line of code:\n```js\ndriver.executeScript(\"window.scrollBy(0,350)\", \"\");\n```\n\nTo scroll up by x (in this case `350`) pixels, you can use the following line of code:\n```js\ndriver.executeScript(\"window.scrollBy(0,-350)\", \"\");\n```\n\nTo scroll to the bottom of the page, you can use the following line of code:\n\n```js\ndriver.executeScript(\"window.scrollTo(0, document.body.scrollHeight);\")\n```\n\n\n## Run your test\n\n```bash\nnpm run single\n```\n\n## Additional Links\n\n* [Advanced Configuration for Capabilities](https://www.lambdatest.com/support/docs/selenium-automation-capabilities/)\n* [How to test locally hosted apps](https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/)\n* [How to integrate LambdaTest with CI/CD](https://www.lambdatest.com/support/docs/integrations-with-ci-cd-tools/)\n\n## Tutorials 📙\n\nCheck out our latest tutorials on JavaScript automation testing 👇\n\n* [How To Generate Mocha Reports With Mochawesome?](https://www.lambdatest.com/blog/how-to-generate-mocha-reports-with-mochawesome/)\n* [Mocha JavaScript Tutorial With Examples For Selenium Testing](https://www.lambdatest.com/blog/mocha-javascript-tutorial-with-examples-for-selenium-testing/)\n\n## Documentation \u0026 Resources :books:\n      \nVisit the following links to learn more about LambdaTest's features, setup and tutorials around test automation, mobile app testing, responsive testing, and manual testing.\n\n* [LambdaTest Documentation](https://www.lambdatest.com/support/docs/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll)\n* [LambdaTest Blog](https://www.lambdatest.com/blog/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll)\n* [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll)    \n\n## LambdaTest Community :busts_in_silhouette:\n\nThe [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe 🌎\n\n## What's New At LambdaTest ❓\n\nTo stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/) \n      \n## About LambdaTest\n\n[LambdaTest](https://www.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.    \n\n### Features\n\n* Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments.\n* Real-time cross browser testing on 3000+ environments.\n* Test on Real device cloud\n* Blazing fast test automation with HyperExecute\n* Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale.\n* Smart Visual Regression Testing on cloud\n* 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more.\n* Automated Screenshot testing across multiple browsers in a single click.\n* Local testing of web and mobile apps.\n* Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.\n* Geolocation testing of web and mobile apps across 53+ countries.\n* LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports\n    \n[\u003cimg height=\"58\" width=\"200\" src=\"https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png\"\u003e](https://accounts.lambdatest.com/register)\n      \n## We are here to help you :headphones:\n\n* Got a query? we are available 24x7 to help. [Contact Us](support@lambdatest.com)\n* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=Mocha-js-scroll)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fmocha-js-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdatest%2Fmocha-js-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fmocha-js-scroll/lists"}