in Education by
I use Selenium RC, for which the scroll command is selenium.getEval("scrollBy(0, 250)"); Now, I have started using Selenium WebDriver , what will be the command for it? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
A scrollbar lets you move around the screen if the page does not fit the visible area of the screen, contrary to Selenium Webdriver in certain webpages the elements become visible only when you have scrolled through them, in such cases scrolling becomes necessary. Now, there are multiple ways of scrolling through a webpage, which will be explained here by the means of scroll down method and same can be implemented for scroll up with minimal changes. There are 3 methods for scrolling :- Scroll up/down by pixel executeScript("window.scrollBy(x-pixel,y-pixel)"); The parameters x-pixel, y-pixel here represents the pixels on the screen, x-pixel would move right if the value is negative and vice versa, y-pixel moves up if the value is negative and down if it is more positive. To scroll up, the pixel could be adjusted to have incremental setup. Scroll up/down by the visibility of the element js.executeScript("argument[0].scrollIntoView();",Element ); The parameter “argument[0]” here represents first index of that page starting at 0. Scroll down to the bottom of page/ up to top of page js.executeScript("window.scrollTo(0, document.body.scrollHeight)"); The parameter "document.body.scrollHeight" here represents the complete height of the webpage. To Scroll up put - documnent.body.scrollHeight and to scroll down document.body.scrollHeight. If you wish to Learn Selenium visit this Selenium Webdriver Tutorial by Intellipaat. If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium certification!

Related questions

0 votes
    I use Selenium RC, for which the scroll command is selenium.getEval("scrollBy(0, 250)"); Now, I ... questions and answers pdf, Verbal Reasoning interview questions for beginners...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    Page scroll up or down in Selenium WebDriver (Selenium 2) using java I use Selenium RC, for which the scroll command ... using Selenium WebDriver , what will be the command for it?...
asked Nov 20, 2020 in Education by Editorial Staff
0 votes
    I'm working on a Java Selenium-WebDriver. I added driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); ... a better way? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am converting my selenium 1 code to selenium 2 and can't find any easy way to select a label in a ... ("//path_to_drop_down"); Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    How to open a new tab in the existing Firefox browser using Selenium WebDriver (a.k.a. Selenium 2)? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    In the HTML of a web app, there is the following code What is actually shown on the page is a string displaying ... . Any help? Thanks. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to put value using webdriver, This is the command I am using driver.findElement(By.name("name")).sendKeys(" ... way to do so ? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I have written tests with Selenium2/WebDriver and want to test if HTTP Request returns an HTTP 403 Forbidden. ... Selenium WebDriver? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Could someone tell me whether Selenium is a good career option? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    I see this only in Chrome. The full error message reads: "org.openqa.selenium.WebDriverException: Element is not ... for scrolling. Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I want to log in to instagram using selenium, but I can't seem to enter values into the fields. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    Which tool is appropriate to set up a Selenium 2.0 Java project (1)Maven (2)pip (3)Depends upon the project (4)Signed dlls...
asked Feb 5, 2023 in Technology by JackTerrance
0 votes
    I am using mac mojave 10.14.3, JDK 1.8, Serenity core 2.0.40 (latest) to develop my test ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    What’s the use of Selenium WebDriver? 1. To run cross-browser tests 2. To automate hardware testing 3. To run UI tests 4. To run load tests...
asked Jul 11, 2021 in Technology by JackTerrance
0 votes
    Which of these events will be notified if scroll bar is manipulated? (a) ActionEvent (b) ComponentEvent (c) ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
...