Skip to content

Commit

Permalink
Simplify capture element screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Dec 14, 2024
1 parent 8e9763c commit 6ef220a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public async Task CaptureElementScreenshot()

var element = (await context.LocateNodesAsync(new Locator.Css("#checky")))[0];

//TODO: ShareId is a type, not string
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new ClipRectangle.Element(new(element.SharedId)) });
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new ClipRectangle.Element(element) });

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (macos, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (macos, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (macos, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (windows, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (windows, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Check failure on line 42 in examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

View workflow job for this annotation

GitHub Actions / tests (windows, nightly)

Argument 1: cannot convert from 'OpenQA.Selenium.BiDi.Modules.Script.RemoteValue.Node' to 'OpenQA.Selenium.BiDi.Modules.Script.SharedReference'

Assert.IsNotNull(screenshot);
Assert.IsNotNull(screenshot.Data);
Expand Down
4 changes: 2 additions & 2 deletions examples/dotnet/SeleniumDocs/SeleniumDocs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="Selenium.Support" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="Selenium.Support" Version="4.28.0-nightly202411252021" />
<PackageReference Include="Selenium.WebDriver" Version="4.28.0-nightly202411252021" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 6ef220a

Please sign in to comment.