tag:help.appveyor.com,2012-11-13:/discussions/problems/3586-black-screenshotsAppVeyor: Discussion 2018-10-19T08:17:36Ztag:help.appveyor.com,2012-11-13:Comment/384749732015-11-16T18:12:22Z2015-11-16T18:12:22Zblack screenshots<div><p>I've just fixed RDP script to correctly identify port on those
VMs. Please try to RDP again.</p>
<p>What's the URL of other project?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-11-16T19:07:40Z2015-11-16T19:07:40Zblack screenshots<div><p>Works fine for - <a href="https://github.com/pywinauto/SWAPY">https://github.com/pywinauto/SWAPY</a><br>
Black screenshots for - <a href="https://github.com/pywinauto/pywinauto">https://github.com/pywinauto/pywinauto</a></p>
<p>There are some difference in appveyor.yml. I tried use latest
Pillow version and disable os: - Windows Server 2012 section.
Unfortunately it did not help.</p>
<p>Thanks for the RDP, trying...</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-11-16T20:53:00Z2015-11-16T20:53:00Zblack screenshots<div><p>What's AppVeyor project URL for this repo: <a href="https://github.com/pywinauto/SWAPY">https://github.com/pywinauto/SWAPY</a>
?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-11-17T06:47:44Z2015-11-17T06:47:44Zblack screenshots<div><p><a href="https://ci.appveyor.com/project/moden-py/swapy-pwvh2">https://ci.appveyor.com/project/moden-py/swapy-pwvh2</a><br>
It is my fork. The last build has good screenshots in the
artifact.</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-11-17T19:48:09Z2015-11-17T19:48:09Zblack screenshots<div><p>The account has been moved to a new environment - there might be
some differences.<br>
Can you run swapy build once again to generate screenshots?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-11-17T20:55:25Z2015-11-17T20:55:25Zblack screenshots<div><p>Feodor, many thanks. The black screenshot now in SWAPY. ;-)<br>
<a href="https://ci.appveyor.com/project/moden-py/swapy-pwvh2/build/1.0.134">
https://ci.appveyor.com/project/moden-py/swapy-pwvh2/build/1.0.134</a><br>
Suppose, for testing, you have switched the environment like for
pywinauto.</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-11-17T21:29:52Z2015-11-17T21:29:52Zblack screenshots<div><p>Well, actually this is the only environment we are going to have
for OSS from now :-)<br>
But what's the difference? Does it expect some drivers or what?
Have you tried looking via RDP?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-11-18T17:02:25Z2015-11-18T17:02:25Zblack screenshots<div><p>I suppose something has changed in the new environment. For
example, Desktop Window Manager (DWM) some functions has been
changed in Windows 8.1 it may cause the problem in Windows Server
2012 R2 we using.<br>
RDP works fine. More, the problem does not affect when I connect a
RDP session.<br>
It seems like some driver sees that there is nobody to draw a
picture. )))<br>
Please, take a look at the attachment, maybe it is a clue. I've not
seen that table while was connecting by RDP.</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-11-18T19:04:41Z2015-11-18T19:04:41Zblack screenshots<div><p>send again</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-11-18T19:20:36Z2015-11-18T19:20:36Zblack screenshots<div><p>That attachment looks OK to me - this is, actually, what you
should see when logged in via RDP.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-11-26T04:36:51Z2015-11-26T04:36:51Zblack screenshots<div><p>I'm experiencing similar behavior when running CodedUI
tests.<br>
It works only if I connect to RDP before the tests are run.<br>
Most of the CodedUI tests fail if I don't connect to RDP and the
screen is just black.</p>
<p>This wasn't happening a month ago.</p>
<p>I'm wondering if there are some power configuration settings,
display settings, or screen saver settings that need to be turned
off.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-11-26T08:38:19Z2015-11-26T08:38:19Zblack screenshots<div><p>Here is an example log file that contains a screenshot:<br>
<a href="https://ci.appveyor.com/api/buildjobs/fvqvyklag2w4a11p/artifacts/a2838df1-316d-4c1c-b38c-1c091a3241da_UITestActionLog.html">
https://ci.appveyor.com/api/buildjobs/fvqvyklag2w4a11p/artifacts/a2...</a></p>
<p>Notice it is all black, no wallpaper, taskbar, desktop icons,
etc.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-11-26T18:19:18Z2015-11-26T18:19:18Zblack screenshots<div><p>Here is an example log file that contains what I expected
screenshots to look like:<br>
<a href="https://ci.appveyor.com/api/buildjobs/jfaaa3dtequwi4ah/artifacts/80d4a023-7495-4a95-92e8-78d1229aca3c_UITestActionLog.html">
https://ci.appveyor.com/api/buildjobs/jfaaa3dtequwi4ah/artifacts/80...</a><br>
That test was run and log created while logged into the build
server using RDP.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-02T01:12:38Z2015-12-02T01:12:38Zblack screenshots<div><p>Hi guys,</p>
<p>If you are willing to help with solving "black screenshots"
problem on OSS environment I have a deal for you! :)</p>
<p>Whoever solves this problem first will get a free one-year
subscription to AppVeyor Pro plan ($590 value).</p>
<p>Please drop me a message if you'd like to participate.</p>
<p>Your help is really appreciated!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-12-02T01:31:28Z2015-12-02T01:31:28Zblack screenshots<div><p>Hi Feodor, I'm willing to try to resolve this issue.</p>
<p>Are there any additional debugging tricks/access I can use to
help resolve this issue?</p>
<p>Thank you.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-02T01:34:55Z2015-12-02T01:34:55Zblack screenshots<div><p>Great, thank you for willing to help with that!</p>
<p>I've moved your account to Pro environment. Now, without
operating system selected builds will be run on Pro environment and
to run on OSS environment select, say, "Visual Studio 2013" OS
image.</p>
<p>These are instructions on how to access build workers via RDP:
<a href="http://www.appveyor.com/docs/how-to/rdp-to-build-worker">http://www.appveyor.com/docs/how-to/rdp-to-build-worker</a></p>
<p>Let me know if you have any questions.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-12-02T05:39:55Z2015-12-02T05:39:55Zblack screenshots<div><p>Thank you.</p>
<p>After some investigation, it seems the issue may be related to
file integrity levels.</p>
<p>In my case, it is specifically on the TestResults directory,
where the tests files are, within the clone directory.</p>
<p>Previously, to circumvent the "Open File - Security Warning"
dialog that appears (and requires user input) when launching exe
files from within the TestResults directory, I had to run the
following before the tests are run:<br>
icacls TestResults /setintegritylevel (CI)(OI)Low</p>
<p>But for some reason, now I have to run the following:<br>
icacls TestResults /setintegritylevel (CI)(OI)Medium</p>
<p>For reference, the "Open File - Security Warning" dialog can
also be circumvented on a larger scope by launching Internet
Explorer > Tools > Internet Options > Security >
Internet > Custom level... > Launching applications and
unsafe files > Enabled (not secure).</p>
<p>However, now when opening HTML files within the TestResults
directory, I get the "Internet Explorer restricted this webpage
from running scripts or ActiveX controls." warning message which
was not happening previously, when the file integrity level was set
to Low, and the HTML files had the appropriate "Mark-of-the-Web"
(MOTW), <!-- saved from url=(0016)<a href="http://localhost">http://localhost</a> --></p>
<p>Thank you.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-03T08:06:17Z2015-12-03T08:06:17Zblack screenshots<div><p>Has anyone else encountered this issue?<br>
Can this issue still be reproduced?<br>
Which project can I fork and test with to reproduce the issue?</p>
<p>Thank you.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-03T09:51:53Z2015-12-03T09:51:53Zblack screenshots<div><p>Hi Rami,<br>
I am still see the problem.<br>
Here is today's try - <a href="https://ci.appveyor.com/project/moden-py/swapy-pwvh2/build/1.0.138">
https://ci.appveyor.com/project/moden-py/swapy-pwvh2/build/1.0.138</a></p>
<p>You may try to fork from <a href="https://github.com/moden-py/SWAPY/tree/dev">https://github.com/moden-py/SWAPY/tree/dev</a><br>
Commit d6f6baf102eac217e6b1497e2b1b8d4d12c0344d generates the black
screenshots.</p>
<p>Thanks</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-12-03T20:06:09Z2015-12-03T20:07:33Zblack screenshots<div><p>Thank you, moden.py, I had to explicitly set the build to use
the Operating System labeled "Visual Studio 2013" in order to
reproduce the issue.</p>
<p>When the build was set to use "Windows Server 2012 R2" or
"Visual Studio 2015", I was not able to reproduce it.</p>
<p>Also, trying to set the build to use "Previous Visual Studio
2013" will also cause black screenshots.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-04T01:32:06Z2015-12-04T01:32:06Zblack screenshots<div><p>Hey guys,</p>
<p>Looks like I've got something! Take a look at these build
results: <a href="https://ci.appveyor.com/project/FeodorFitsner/swapy/build/1.0.4">https://ci.appveyor.com/project/FeodorFitsner/swapy/build/1.0.4</a></p>
<p>In short, to make UI tests work add this line to your
appveyor.yml <code>install</code> section:</p>
<pre>
<code>install:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))</code>
</pre>
<p>The <a href="https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1">
script</a> downloads FreeRDP client and connects via RDP to
localhost thus creating a new RDP session. All build commands
following this line will be running in that RDP session.</p>
<p>I'm not yet completely sure how that works, but it works :)
Maybe the approach could be further improved/optimized as, for
instance, active RDP client adds some CPU overhead to the build
worker.</p>
<p>Anyway, give it a try for your builds and let me know how it
worked. I'm going to document it.</p>
<p>Btw, there is a "bonus" - you can set desired screen size like
that:</p>
<pre>
<code>- ps: $screen_resolution = '1280x800'; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-12-05T13:54:44Z2015-12-05T13:54:44Zblack screenshots<div><p>Hi Feodor,<br>
It does work for me!<br>
Thank you very much.<br>
Indeed, it seems like some optimization disables desktop drawing
when nobody attached to the desktop.<br>
The possible slowdown is not a problem (at least now :-)))), so I
am marking the issue as FIXED.</p></div>moden.pytag:help.appveyor.com,2012-11-13:Comment/384749732015-12-05T16:57:27Z2015-12-05T16:57:27Zblack screenshots<div><p>Great, thanks for the update!</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-12-05T21:23:51Z2015-12-05T21:23:51Zblack screenshots<div><p>Thank you.</p>
<p>I found this related issue / feature request:<br>
<a href="https://code.google.com/p/google-compute-engine/issues/detail?id=184">
https://code.google.com/p/google-compute-engine/issues/detail?id=184</a></p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-21T06:45:32Z2015-12-21T06:45:32Zblack screenshots<div><p>Unfortunately, I'm still having issues even when using FreeRDP
and it seems to be directly related to the keyboard.</p>
<p>For example, sometimes a call to Keyboard.SendKeys would cause
my coded ui tests to fail unless I'm actually connected using
Microsoft's RDP implementation.</p></div>rami.abughazalehtag:help.appveyor.com,2012-11-13:Comment/384749732015-12-21T21:25:25Z2015-12-21T21:25:25Zblack screenshots<div><p>Can you provide a sample of such test?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/384749732015-12-22T07:33:53Z2015-12-22T07:33:53Zblack screenshots<div><p>See the failed tests here:<br>
<a href="https://ci.appveyor.com/project/icnocop/cuite-cdb3i/build/tests">https://ci.appveyor.com/project/icnocop/cuite-cdb3i/build/tests</a></p>
<p>The corresponding github project is here:<br>
<a href="https://github.com/icnocop/cuite/tree/specs">https://github.com/icnocop/cuite/tree/specs</a></p>
<p>Thank you.</p></div>rami.abughazaleh