Screen Capture Exception

23 views
Skip to first unread message

Ethan Padden

unread,
Feb 17, 2020, 10:35:33 PM2/17/20
to Selenium Users
Hi all,

I am having trouble running automated tests on a server using Selenium. They have been working for a long time but recently an exception is getting thrown. I have a method that creates a  Microsoft.Expression.Encoder.ScreenCapture object, but when its constructor is called, the following exception is thrown:

Failed   SetupRequiredBeforeTesting
Error Message:
   Test method Testing.Tests.NewBuildSetup.SetupRequiredBeforeTesting threw exception: 
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Invalid Height specified. The value must be an even integer between 4 and 4096 and a multiple of 4.
Stack Trace:
    at Microsoft.Expression.Encoder.ScreenCapture.ScreenParameters.set_Source(ScreenSource value)
   at Microsoft.Expression.Encoder.ScreenCapture.ScreenParameters.Reset()
   at Microsoft.Expression.Encoder.ScreenCapture.SessionParameters.GetDefaultSessionParameters()
   at Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob..ctor()
   at Testing.Tests.NewBuildSetup.SetupRequiredBeforeTesting() in c:\JenkinsDevOpsWorkspace\Tests\Tests\NewBuildSetup.cs:line 71

When I remove the following code from the start of the test, it runs correctly:
ScreenCaptureJob testVideo = new ScreenCaptureJob();

Any ideas are greatly appreciated.

Many thanks,
Ethan Padden.
Reply all
Reply to author
Forward
0 new messages