lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

macOS: System.DllNotFoundException: Unable to load shared library 'libgdiplus' #504

Open knocte opened 4 years ago

knocte commented 4 years ago

Describe the bug When a test fails in macOS, it prints an unrelated DllNotFoundException:

08/04/2020 22:08:27: Error during fail reporting: System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibgdiplus, 1): image not found
   at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr& image)
   at System.Drawing.Image.InitializeFromStream(Stream stream)
   at System.Drawing.Image.LoadFromStream(Stream stream, Boolean keepAlive)
   at canopy.parallell.functions.pngToJpg(Byte[] pngArray)
   at canopy.runner.classic.fail$cont@96(Exception ex, Test test, suite suite, Boolean autoFail, String url, Unit unitVar)
Error: 
element not interactable
  (Session info: chrome=84.0.4147.105)
Url: https://accounts.google.com/signin/v2/challenge/pwd?redirect_uri=storagerelay%3A%2F%2Fhttps%2Ftinder.com%3Fid%3Dauth701928&response_type=permission%20id_token&scope=email%20profile%20openid&openid.realm&client_id=230402993429-g4nobau40t3v3j0tvqto4j8f35kil4hf.apps.googleusercontent.com&ss_domain=https%3A%2F%2Ftinder.com&fetch_basic_profile=true&gsiwebsdk=2&flowName=GeneralOAuthFlow&hl=en&cid=1&navigationDirection=forward&TL=AM3QAYbiG-Eq5hMgjtRIdd-nY9nhq1Jr_pA8dfvHzwpkc6wtZPYw0h6hfCDcsaoI
Exception details: 
OpenQA.Selenium.ElementNotInteractableException: element not interactable
  (Session info: chrome=84.0.4147.105)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text)
   at Program.login@30.Invoke(Unit unitVar0) in /Users/knocte/Documents/Code/PScraperCLEAN/src/PScraper/Program.fs:line 56
   at Program.clo@27.Invoke(Unit _arg1) in /Users/knocte/Documents/Code/PScraperCLEAN/src/PScraper/Program.fs:line 234
   at canopy.runner.classic.tryTest[a,b](a test, b suite, FSharpFunc`2 func)

0 minutes 22 seconds to execute
0 passed
0 skipped
1 failed
press [enter] to exit

To Reproduce Steps to reproduce the behavior:

  1. Make a canopy test that will fail
  2. Run tests with chrome in macOS

Expected behavior Should not throw a DllNotFoundException in the log.

Desktop (please complete the following information):

RFC: https://pbs.twimg.com/media/EemXtWyXYAMx_qb?format=png&name=large ..., therefore maybe dependency System.Drawing.Common should be replaced with ImageSharp