watir-webdriver black screenshots - webdriver

I'm using watir-webdriver to navigate around my website and grab screenshots in different browsers.
Sometimes the screenshots taken in IE turn out the right size, but colored entirely black. The firefox tests that get run at the same time look fine.
browser.driver.save_screenshot(screenshot_dir)
Once I remote desktop to the computer running the tests the IE screenshots look okay again. A little bit after leaving remote desktop the IE screenshots go black again.
I'm running these tests on a instance of Windows Server running on ec2.

Based on your comment that remotely accessing the machine resolves the problem for a little while... disable the screensaver on that box. I'm not sure how (if at all) the screenshot functions on IE and FF differ, but it's worth the time it would take to test the change.
Edit: I still feel like it's windows/power setting related as you logging into the box appears to have an effect, but I don't know what else specifically that could be. I tried a programmatic approach below vvv.

From what you are saying, it sounds like the Windows system is automatically locking, like it should. This would explain why screenshots work fine when you remote in, and then go to black several minutes later when the screensaver kicks in and locks your system.
If the Windows system is locked, screenshots are blacked out. This is a Windows security feature.
I would be curious to know if FF really does do screen captures on a locked system.

Here's the code I'm using to capture screenshots (Watir-Webdriver, Cucumber). I use remote Windows XP VMs for my test boxes, and have not encountered the issue using Firefox or Internet Explorer.
We did find that when you view the log with the embedded screenshot, it does not seem to work in IE - so you have to use Firefox for viewing. It's base64, so there doesn't seem to be a logical reason for this.
After do |scenario|
if scenario.failed?
encoded_img = #browser.driver.screenshot_as(:base64)
embed("data:image/png;base64,#{encoded_img}", 'image/png')
end #
end

Related

JxBrowser | Content not rendering

I am experiencing an issue related to the displaying of any content within the JxBrowser, but only for 1 specific client PC.
The JxBrowser seems to correctly process the content that is sort of present, because if I click on an area where I know there is a link, the new page is opened (but not rendered too).
The "pages are not displayed" means that the content is completely white. Furthemore, the pointer is repetitively blinking between the normal arrow icon and the waiting circle, as something is going on in the background every about 1 sec.
A previous version of the application that embeds the JxBrowser doesn't produce the same problem.
Later on, I have also upgraded the JxBrowser version from the 6.23 to 6.24.3, but this did not solve.
Deleting any caches produced by the presence of the JxBrowser on the PC did not solve either.
What should I investigate to try and address this situation?
First of all, please note that JxBrowser 6 is no longer supported and it's a very old version based on Chromium 69. A lot of popular websites might not work properly in this Chromium version.
If the issue is reproducible only in a specific environment, then it's probably an environment-specific issue. If we are talking about rendering, then usually Chromium cannot render content when there's an issue with GPU drivers and the rendering mode (heavyweight or lightweight).
From our practice, disabling GPU very often helps in such cases. Please try passing the --disable-gpu switch and see if it helps. If it doesn't help, then the issue is probably in something else and additional research or even access to this environment is required. But again JxBrowser 6 is no longer supported.
As an option you can try JxBrowser 7 and see if it helps, but it's not that easy because this version has a new API which is not backward-compatible with the previous version.

Bootstrap content not rendering properly in ASP.NET

The problem is awkward because everything worked fine. I opened the laptop and somehow it crashed and didn't corresponding to any commands so I had to turn it off. After I started again and after building my project(just in case anything was wrong) and opened my web page I realized that bootstrap is not working at all, and I can't figure out why because I didn't do anything. I tried to install a lower version and didn't worked and after I install the latest stable version and not didn't worked again. If you need any source code let me know and I will edit my post. I will put a picture below which describes what I am talking about(or at least I hope so).
It has the appearance of running in IE Compatibility mode, even though you're on Chrome. Try refreshing your cache (Control+Shift+Delete), rebuilding your project, and using a different browser.
I've run in to this issue before and refreshing the cache usually does the trick.

CSS and Button issue occurs only in IE7 and Windows Server 2008

I have a CSS issue that appears to only be reproducable when viewing the webpage in IE7 on a Windows 2008 web server. The issue does not occur when viewing the page on my dev version of the website (which is a widnows 7 environment). Note: the windows 2008 server and dev code (and database data) are the same.
The problem is when a popup is displayed, one of the buttons poistion is not updated (actually, the image for the button is not updated, the button itself has moved but is not displayed as such). This kind of problem is usually straight forward to fix because you can inspect the elements in IE9, but in this case you can't see the HTML that is output and you cannot select the elements in the popup. I cannot reproduce this on my dev machnine and cannot inspect the button element in the browser as you usually would be able to.
Are there any known issues that can be caused simply by websites being hosted on certain versions of windows server? (I can't think of anything else that's different beteween dev environment and the server)
I have researched on the internet but there seems to be very little regarding this specific issue. The best guess I have is that it may be caused by something being used by the site called PIE.htc and it may be one of the issues listed here: [http://css3pie.com/documentation/known-issues/][1]
[1]: http://css3pie.com/documentation/known-issues/ but this is a long shot and I have no way of verifying whether this is the case because the code must first be deployed to the 2008 server (I cannot reproduce it in dev environment and cannot inspect elements)
I cannot think what else could be causing this issue so any any suggestions will be very much appreciated.

CSS Works In IE8 With Linux/Apache2.0/PHP4 But Not With Windows/IIS7/PHP5

I just changed from a linux/apache2.0/php4 web server to a windows/iis7/php5 web server (I only post php versions since that was a significant change).
My css is working just fine on the linux one (http://66.119.8.165/flcunderconstruction.php) but it isn't working on the windows one (http://66.119.8.236/flcunderconstruction.php).
Now, the issue only seems to be applicable to internet explorer 8 (maybe older, but I'm not testing those). Firefox and internet explorer 9 work just fine.
I think I've ruled out php issues as I created a non-php version (http://66.119.8.236/flcunderconstruction.html) and the issue persists.
I'm assuming the problem is in the css (which is quite large and throws up a lot of validation errors). But since it only occurs on the windows server and with ie8, I'm hesitant to start whacking away at the code.
Any ideas?
JJ
The broken version stops loading when it hits /include/html5.js. You only see this on IE8 because later versions handle the HTML5 stuff just fine without the polyfill.
Missing: http://66.119.8.236/include/html5.js
Present: http://66.119.8.165/include/html5.js
To test this, press F12 to open up the Developer Tools. Switch your Browser Mode to IE8. Jump over to your Network tab and press "Start Capturing". Perform a hard refresh (CTRL+F5), and watch as the files begin loading in. You'll note the 404 when it gets to the HTML5 polyfill. (Image below)
Using Fiddler2, I set up and Auto Responder to automatically add the HTML5 file from my local machine in the place of your missing file. Refreshing the request resulted in the entire site loading as expected in IE8. Put your polyfill on the other server, and you should be set.

Visual Studio 2010 slow debugging

I have a problem with Visual Studio 2010. When I start debugging it works slowly.
Internet Explorer opens, but the website loads extremely slowly.
My workmate and me work on the same project and he doesn't have any problem like that.
My hardware is 4G memory + Intel Core i5 CPU 3.20 GHz.
I stopped my anti-virus program but it couldn't be resolved.
I've had the same problem for over a year! And I solved it :)
I took me about 20 seconds to start debugging, and about 1 minute to stop it. It also took 2 minutes to load the solution! My colleague had NO problems with the same solution.
I found my way out of it by a coincidence.
I CHANGED the NAME of the solution, and things suddenly happened 30 times faster.
I CHANGED the solution name back and it slowed down again!
This is probably a FUBAR error made by the Microsoft development team. Don't try to figure out why it happens :)
This might be a IPV6 issue (that shows itself in windows vista/7 when using firefox or IE). I've had that at work and this is what made pages load instantly when using localhost (instead of the 20+ seconds that could happen on image-heavy websites I was developing).
IPv6 (taken from Firefox cannot load websites but other programs can )
Firefox supports IPv6 by default, which may cause connection problems on certain systems. To disable IPv6 in Firefox:
In the Location bar, type about:config and press Enter.
The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise!, to continue to the about:config page.
In the Filter field, type network.dns.disableIPv6.
In the list of preferences, double-click network.dns.disableIPv6 to set its value to true.
For Internet Explorer, try using http://127.0.0.1:PORT_NUMBER/ where PORT_NUMBER is the port you can see in your address bar. If the loading of the page is faster, then you might want to go check the C:\Windows\System32\drivers\etc\HOSTS file and make sure the only line mentioning localhost looks like 127.0.0.1 localhost.
Check to see if you have _NT_SYMBOL_PATH environment variable set. Getting symbols or pdb files for the assemblies used by your application from a symbol server could be the cause of the slow startup of your application when debugging. You can also look at the symbols setting in VS>Tools>Options>Debugging. Also, take a look at the output window and the status bar down at the bottom in VS when your app is loading and taking a long time to see what VS is busy doing.
Not sure if this applies to ASP.NET applications, but disabling the 'Show Parameter Values' option in the Call Stack window's context menu considerably speeds up the debugger on my machine.
Two things to check.
1. Remove all the parameters in the watch list.
2. Build >> Config Manager , Check the Configuration Mode: Debug/Release.
I have encountered the same problem. I could make it better by deleting the Folder created in the temporary aspnet folder. For that you need to close the solution that you have opened and then delete. I don't know if there is any other solution.

Resources