Skip to content

Commit 19793d7

Browse files
committed
@javiercn's feedback: selenium gives absolute position.
1 parent 8b62ae8 commit 19793d7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ public static long GetElementPositionWithRetry(this IWebDriver browser, string e
4949
{
5050
browser.WaitForElementToBeVisible(By.Id(elementId));
5151
var element = browser.FindElement(By.Id(elementId));
52-
var elementLocation = element.Location.Y;
53-
54-
// Get scroll position using JavaScript (this is less likely to fail than element positioning)
55-
var jsExecutor = (IJavaScriptExecutor)browser;
56-
var scrollY = (long)jsExecutor.ExecuteScript("return window.scrollY");
57-
58-
return elementLocation + scrollY;
52+
return element.Location.Y;
5953
}
6054
catch (Exception ex)
6155
{

0 commit comments

Comments
 (0)