Skip to content

Commit

Permalink
Merge pull request #3882 from Ginger-Automation/BugFix/42091-Exceptio…
Browse files Browse the repository at this point in the history
…nWithMaximizedVRT

BugFix - 42091 - Added check for 0,0 Viewport Size
  • Loading branch information
IamRanjeetSingh authored Aug 28, 2024
2 parents 1c7b6a4 + ed32c43 commit 7d1d3d3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ private void ThrowIfClosed()
}
byte[] screenshot;
if (fullPage)
if (fullPage)
{
screenshot = await tab.ScreenshotAsync();
}
Expand Down Expand Up @@ -1574,6 +1574,11 @@ public VisualElementsInfo GetVisualElementsInfo()
public void ChangeAppWindowSize(int width, int height)
{
ThrowIfClosed();
if (width <= 0 || height <= 0)
{
//for VRT action, it passes widht and height as 0 to maximize which causes issues with Playwright, so ignoring those
return;
}
Size size = new(width, height);
Task.Run(() => _browser.CurrentWindow.CurrentTab.SetViewportSizeAsync(size).Wait()).Wait();
}
Expand Down

0 comments on commit 7d1d3d3

Please sign in to comment.