Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6592311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:32:18+00:00 2026-05-25T17:32:18+00:00

Im doing webtest using selenium Webdriver in C#. But I’m having a problem where

  • 0

Im doing webtest using selenium Webdriver in C#. But I’m having a problem where when the browser window isn’t in full size a popup will open half way outside the visible area.

The problem is that when i fire a .Click(); it doesn’t do anything because the link i attempt to click is outside of the viewed area.

So how do i focus on the link to get click to work? Im currently using the following workaround but i don’t think that’s a nice way.

        _blogPostPage.FindElement(By.XPath(_popupLogin)).SendKeys("");
        _blogPostPage.FindElement(By.XPath(_popupLogin)).Click();

The sendkeys with space focuses on the link and makes Click work everytime, but isn’t there a right way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:32:19+00:00Added an answer on May 25, 2026 at 5:32 pm

    We’ve been playing with Selenium and have run into this problem as well. I don’t know if it’s the WebDriver as a whole, the C# implementation, the version of Firefox etc, but we have found an ok workaround:

    The trick is to force Selenium to evaluate the LocationOnScreenOnceScrolledIntoView property on the RemoteWebElement class (which is inherited by FirefoxWebElement and implements IWebElement). This forces the browser to scroll so that the element is in view.

    The way we’ve done it is to use an extension method:

    using OpenQA.Selenium;
    using OpenQA.Selenium.Remote;
    
    namespace Namespace
    {
        public static class ExtensionMethods
        {
            public static IWebElement FindElementOnPage(this IWebDriver webDriver, By by)
            {
                RemoteWebElement element = (RemoteWebElement)webDriver.FindElement(by);
                var hack = element.LocationOnScreenOnceScrolledIntoView;
                return element;
            }
        }
    }
    

    this way all we have to do is change the generated code from:

    driver.FindElement(By.Id("elementId")).Click();
    

    to:

    driver.FindElementOnPage(By.Id("elementId")).Click();
    

    Hope it works for you!?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Doing a little garbage collection here and using a subquery, which I know isn't
Doing an ajax get request works as expected using the following code: $.ajax({ type:
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
Doing a search using django-sphinx gives me results._sphinx that says there were 68 results,
Doing DJango 1.3 local development using manage.py runserver Created a directory called static in
Doing cross platform development with 64bit. Using gcc/linux and msvc9/server 2008. Just recently deployed
Doing a Socket.Receive(byte[]) will get the bytes in from the buffer, but if the
doing this in AppDelegate: viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; Is there any problem
Doing odd/even styling with jQuery is pretty easy: $(function() { $(.oddeven tbody tr:odd).addClass(odd); $(.oddeven
Doing my first SL4 MVVM RIA based application and i ran into the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.