I have an element that is out of view when I am using Selenium within an iFrame. I have switched the context using


and I am able to interact with elements that are visible in the iFrame. However when I need to interact with elements that are inside the frame but out of view I cannot find a way to force the Frame to scroll down.

I have tried running some javascript: Scrolling and iframe with Javascript

Also tried using the technique described in the following article

I have tried tabbing on the last visible element to force the frame to scroll down, which works in some cases but I need a more concrete solution.

Any help would be greatly appreciated.

1 Answer 1


I managed to get around this issue by creating a static method that scrolls down the page:

public class Browser
    public static IWebDriver Driver { get; set; }
    public static ITargetLocator CurrentFrame { get; private set; }

    public static void SwitchFrame(string frameId)
        CurrentFrame = Driver.SwitchTo();

    public static void ScrollDown()


Browser.Driver = new InternetExplorerDriver();

I just call the ScrollDown method whenever I know an element is out of view and it does the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.