How to fix Bitmap failed to stabilize error on Silk Test - silktest

getting Bitmap exception on captureBitmap() method for desktop application in silktest workbench
With _desktop.FormsWindow("AppMainWindow")
.CaptureBitmap("C:\Snapshots\ErrorImage.PNG")
.PushButton("buttonOK").Click()
End With
Exception:
Silk Test Workbench
Playback error in the .NET Script 'TestSuiteDriver':
SilkTest.Ntf.BitmapNotStableException:
Bitmap failed to stabilize.
added the below code in vb.net script.
Agent.SetOption(Options.BitmapMatchCount, 0)
Agent.SetOption(Options.BitmapMatchInterval,0)
Agent.SetOption(Options.BitmapMatchTimeout,0)
but still getting the exception.
Need to configure something in the Silk Test Workbench?

I would increase the timeout to something larger and the match interval as well. That way it gives the Workbench more time to detect the bitmap. Setting them all to zero means it will check once and then stop.

"SilkTest Open Agent" is a background process running locally when silk test
workbench tool is opened.
Stopped the already running open agent, and re-run the new Open Agent process and executed the script. It fixed the "BitmapNotStableException".

Related

WPF application crashes when run in Jenkins service but not as a regular user

I am automating some software testing using Jenkins on our in-house test software. It is written in C# with WPF. I am using the version of the program that has no frontend, but it still makes calls to WPF in order to start the service. The test application is launched through python scripts using subprocess.Popen
When running under the Jenkins slave process I get the following error:
Unhandled Exception: System.ComponentModel.Win32Exception: The operation completed successfully
at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
...
From my research it seems that something is going wrong with the windows atom tables. The weird thing is that I don't run into the same issue when running the python scripts as a local user, it only crashes when it is the Jenkins service running the scripts.
Is there some limitation on the local atom table for windows services?
Is Jenkins hogging atom table entries?
Update 1:
I did some more research on the crash and some resources said for WPF there might be a windows handle leak, so I inserted some power shell calls to check how many active handles there are on the system.
It doesn't look like there is a handle leak from any of the software under test, I am seeing around 50-60k handles while jenkins is running the test scripts, which is consistent with what I was seeing while running it under my user account. It looks like Jenkins is interfering with WPF's ability to construct the program (The full callstack for the error is on the Main() constructor), but I have no idea why it would be doing that.
Update 2:
Some extra information since I think it is relevant, here is the full call stack:
Unhandled Exception: System.ComponentModel.Win32Exception: The operation completed successfully
at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Threading.Dispatcher..ctor()
at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
at System.Windows.Application..ctor()
at <TestingApplication>.ScriptHost.App..ctor()
at <TestingApplication>.ScriptHost.App.Main()
So what appears is happening is the following:
Jenkins calls the python scripts. They perform setup and all pre-condition work such as bringing up the software under test
Python calls the TestingApplication through Popen
The executable starts and attempts to construct the application
WPF checks to see if there is a Dispatcher already on the thread, there is not
WPF attempts to create a Dispatcher since one doesn't already exist
Crash because a Dispatcher cannot be created
Again, this only happens when launched under the Jenkins service user.
So here's what I did to fix the problem:
The software under test also uses WPF to create the displays, so I wanted to see if maybe i'm running out of resources by having too many things open. There are 5 SUT applications. Luckily, one of the pieces of software we run is a console that I don't need open when running tests through Jenkins. Thus I was able to not launch the console application and that freed up enough resources for the test application to run.
What this doesn't answer is:
Why do I have less resources on a service compared to a regular user?
Is this because of Jenkins/Python or because of Windows?
Is there a workaround for this problem?
Those questions could be asked outside of this question so I am answering just so that it is available to someone with a similar problem and to close it. For someone who doesn't have the luxury of closing extra applications, I would ask those questions yourself.

How to hide scheduled Selenium/ChromeDriver Tests in Windows

We have automated web tests which use the chromedriver.exe and which have proved difficult to automate and schedule. The only way were able to run them on a scheduled task was to run as the group "Administrators". Any other user (even admins) and the task simply did not run.
Anyhow, the problem now is that the task windows pop up constantly when we are on the server. Checking the "hidden" box has not helped, they still pop up.
How can we run these tasks silently in the background?
Notes:
We are running chromedriver in "headless" mode i.e. no Chrome GUI.
We have tried the HideCommandPromptWindow option to no avail

Batch taskkill won't kill

Ok so I'm trying to end Comodo (free firewall service) so that I can install NVidia driver updates, and since I'm super lazy I want this all to be automatic whenever NVidia tries to update. After I want to reopen Comodo.
However I'm stuck on the first step since I have no idea on how to properly end Comodo, when I try taskkill it says:
ERROR: The process "cis.exe" with PID 6204 could not be terminated.
Reason: Element not found.
I'm new to batch and have no idea what this error message means since I can clearly see that "cis.exe" (which is Comodo) is running in the background at least and I can close it from the icon tray if I wanted to, and it spits out the same message when I try using "CisTray.exe".
Also any advice on where I should go for the next few parts would be greatly appreciated, thinking on using task scheduler to open the batch file when some kind of log or something is made by NVidia.

"Operation in progress..." Never Ends When Previewing Rows in Kettle Spoon via Salesforce

I am trying to pull data from a Salesforce API account using Pentaho/Kettle Spoon. I am able to establish a connection on Pentaho with this account. I am also able to get fields from specific modules. However, when I try and "Preview rows" (even with a small number of rows), the "Operation in Progress" window comes up and never completes the task. When I try and cancel the job, Pentaho hangs and I have to force quit it.
I am running Fedora 21. Any input is greatly appreciated.
Thanks!
This works for me:
Since upgrading to Fedora 22 Spoon (the client tool of PDI) was not working properly anymore. Although I could start Spoon properly and create transformations etc, once I wanted to execute a transformation or sometimes even when trying to open settings, nothing was working and the terminal window showed several (SWT:20352): GLib-CRITICAL error messages. In a nutshell, Spoon was rendered useless.
Here is how to solve this:
Go to the Eclipse Download Page and download the latest 64bit verion of Eclipse IDE for Java EE Developers. Note: There is a separate download area for SWT; however, for Linux there is no 64 bit version available. The only way to get one is to build it yourself. So I just went the easier way and downloaded Eclipse instead.
Unzip the file and search for swt. A search result will show a few files, but the ones interesting for us are (your version number might be different): org.eclipse.swt_3.103.2.v20150203-1313.jar and org.eclipse.swt.gtk.linux.x86_64_3.103.2.v20150203-1351.jar.
Copy the first one of these files into <PDI_HOME>/libswt/linux/x86 and the second into <PDI_HOME>/libswt/linux/x86_64.
oth folders still have the original jar files in them. Rename them to swt-jar-old (Note: no extension, so that they are not picked up).
Start Spoon. There will be a few error messages shown, but so far Spoon is working way better for me than before.
FONT: http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
i'm running Ubuntu 14.04, i5,6gb RAM, got same trouble..
when i check, the load in proccessor is 100%, evertime i try showing the content or other thing in pentaho, the Operation in progress is show up, and never end..
How to solve, check your access to file/connection in your database,unrecognize file,field,etc. after this resolve, my proccessor run normal, and i could run / execute the transformation.

Jenkins task to switch on monitor if it's switched off

I use Jenkins to run our builds. What I want to do is to wakeup the monitor before build starts. This is what I have done so far.
Use nircmdc.exe (http://www.nirsoft.net/utils/nircmd.html) and prepare a batch file to turn on monitor. I have tested the script through command prompt and it works fine.
Then I add a build step in Jenkins to execute windows batch file before running the ANT script. Then I remote start the build (via URL). Console shows that the batch file is being executed. But the monitors doesn't wake up.
Then I included a target in ANT to execute the same batch file and tested running the ANT via CMD. This wakes up the monitor and continue with the build steps.
But, if I run this ant script from Jenkins, everything works fine except waking up the monitor.
Is this something to do with privileges ?
Has someone done something similar?
Don't think I've ever heard of a requirement to wake up the monitor, so probably no one has done anything like this.
However, your problem is probably due to Jenkins process running in a separate session from your machine's console. Have a look at my answer here: Open Excel on Jenkins CI, it explains how to get around the session issue.

Resources