Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen screenshot/video #64

Open
fengnex opened this issue Dec 10, 2020 · 6 comments
Open

Black screen screenshot/video #64

fengnex opened this issue Dec 10, 2020 · 6 comments

Comments

@fengnex
Copy link

fengnex commented Dec 10, 2020

General information:

  • OS name: Windows 10
  • OS version: 10
  • OS architecture: 64 bits
  • Python version: 3.7.4
  • mss version: 6.0.0
  • pygtk usage: no_

Only when we open the remote RDP desktop, the recoreded screen/video is OK, and both will be black screen at any other time. Any idea on how to fix the problem?

The test server has no a monitor.

@cristii006 cristii006 added the duplicate This issue or pull request already exists label Dec 10, 2020
@fengnex
Copy link
Author

fengnex commented Dec 10, 2020

We use Seleniumlibrary to test a web application and this library can always correctly capture an image when any test fails, even though ScreenCapLibrary got a black screen, so what I suggest is that ScreenCapLibrary can utilize a similar way with that of Seleniumlibrary to ensure the recorded gif is OK, which I believe will mitigate the problem at least.

I mean, ScreenCapLibrary can also capture a series of pictures in a way that is similar to that of Seleniumlibrary in the test process and generate the required gif picture at last. What I think now is that this solution may be able to avoid the black screen problem.

@cristii006 Would you be so kind as to talk about your opinions about the above suggestion?

@fengnex
Copy link
Author

fengnex commented Dec 10, 2020

@cristii006
This is not a duplicate of #24 because we do not use the headerless mode and the platform we are using is windows 10. I have actually read the post of #24 before posting this one.

However, we met a similar problem when trying to capture the screen with ffmpeg, and in that case, ffmpeg does not generate a file either. I'm still not clear about the relevant root cause and am guessing it is something related to Windows OS.

@cristii006 cristii006 removed the duplicate This issue or pull request already exists label Dec 10, 2020
@cristii006
Copy link
Contributor

cristii006 commented Dec 10, 2020

@fengnex I see, my bad I will remove the label, can you provide any additional details that can help us reproduce the error?

@fengnex
Copy link
Author

fengnex commented Dec 10, 2020

I checked relevant logs and found no errors or warnings.

We run an RF script on a remote Windows 10 that has no monitor connected physically, and the captured video/gif is OK ONLY when the RDP window is open, but the result video/gif will be a black screen once the RDP window is closed.

We verified one example: after ScreenCapLibrary started its capture process for a while but with no opened RDP window and then we opened an RDP window, from then on the result video/gif was correct, although it was all black screen before that occasion. Maybe this could help to reproduce the problem.

ScreenCapLibrary seems pretty mature and wonderful, and I hope it will be better and develop quickly. Thanks!

@cristii006
Copy link
Contributor

Hello @fengnex,

This is currently a limitation of ScreenCapLibrary that is coming from mss that is described here. As @mihaiparvu described in #24 an alternative would be the usage of VNC Server, in order to solve your problem.

Best regards,
Cristi

@fengnex
Copy link
Author

fengnex commented Feb 20, 2021

The following way recommended by https://superuser.com/questions/1288469/remote-windows-server-virtual-machine-always-keep-desktop-open-simulate-rdp-se# cannot work on windows server 2019, which has been confirmed:
In the Registry, navigate to the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
As necessary, create and populate the following values. They are all of type REG_SZ (String):

Value Data Example


AutoAdminLogon 1 1
DefaultDomainName <Domain_Name> CONTOSO
DefaultUserName JohnDoe
DefaultPassword P@ssw0rd!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants