Silverlight tests not working unless RDP connection open - silverlight

I have a few Silverlight UI tests that I'm automating with White. These tests are subsequently run by a TFS build agent, which is running interactively so it can access the desktop.
The build passes if I have a Remote Desktop connection open to the build agent as the tests are run; I can see the mouse pointer moving around. When the test clicks on a HyperlinkButton navigation takes place, and is subsequently verified by assertions within the test.
The build fails if I do not have a Remote Desktop connection open to the build agent as the tests are run. The Internet Explorer window is created and the Silverlight app loads, but no clicks happen; the application remains on the initial page and test assertions subsequently fail.
Has anyone out there found a solution to this problem?

See Starting a Windows service in an interactive session
If you are setting up a windows service, that service can be set to run with an interactive desktop, though it will be running as a local machine user and not a domain user.
The other alternative is tweaking the registry to use the AutoAdminLogon feature. Use with caution!
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon:
DefaultUsername
DefaultPassword
DefaultDomain
AutoAdminLogon = 1

The answer is on this CodePlex thread. Basically there is no solution; White tests must be run by a logged-in user (either physically, or via VNC or RDP).

Related

Testing with Internet Explorer on Selenium Grid with node as Windows service

We have build several Selenium tests of our corporate portal. The next step is to test on a Selenium Grid setup. We have access to a Hub and a Node which are started as a service on a Windows Server. We can connect to the Hub and the tests are started on the Node.
Because the Node is started as a service the tests are executed in the background. The tests have to be executed in IE11 because the portal only works correctly on that browser. So far so good.
Only our tests of the portal do not execute properly. The portal is made in Tibco and contains ActiveX elements and a lot of scripts.
We tried several possible solutions:
Started the service (of the node) with an actual user instead of the System user
Lowered all security settings
Switched protected mode in all area's
Added the portal url to the Trusted Sites
But nothing worked.
We also tried a test on a very simpel website with only a textbox and a button and that worked. Also when we navigate to the portal from the server where the node is located everything works fine.
Only when the tests are executed from the background it looks like the website cannot be properly loaded.
Has anyone encountered this problem before? Or does anyone know how to troubleshoot this issue?

Can you Run winform app in the cloud as a process?

Currently, I have full access to a local Windows IIS System in which we execute a windows forms application as a processes in which the winform app runs and takes a screen shot of itself and the web call returns the URL of the saved image. The full process looks like -
User navigates to webpage
User inputs variables on web page and submits it to IIS end point.
IIS takes variables, runs Process.Start on winform app passing in variables.
IIS returns the URL from the screen capture of the winform app.
Is this something that is doable on Azure or Amazon? I'd like to put this in the cloud but I'm not sure if security restrictions would prevent an app like this from being executed as we had to give specific permissions to get this to work.
If you do this now on a server with IIS, you would be able to do it in the cloud (azure or amazon although I have no amazon experience so I'm guessing). The real question is what would you have to deploy. In this case, you cannot use an app service as your platform for this, you would have to run it in a virtual machine with IIS and configure everything as you do now. Or, if you are adventurous and need load balancing, etc. you could try a virtual machine scale set.
One caveat, since I do not know what the windows application does, what it depends on, you may need to put in some networking configuration if the windows app communicates back to an on-prem database or file store.

make C# window application as window service

I have a desktop application in C# and i want to make that a window service. Is it possible to make that application as a windows service? Basically i want an app that shows gui when needed and upone minimizing it goes to system try, and it should also appear in services... For application just take an example that my application have a timer and multiline text field and its also interacting with database and its showing timely status from database so when i need to see it i can start GUI from system try?
Any kind of help would be highly appriciated. Thanks!
You will need to separate your applications. Windows Service and desktop. You will need to build API hooks into your Windows Service to allow communication from your desktop application and the service. I would recommend WCF for this.
In a nutshell, a Windows Service should not interact with the desktop. It will run in a separate session than the session you are logged into, even if you are logged in as the same account the service is running under.
It is not possible to show GUI in a windows service.
What you can do is:
a. Seperate client logic from server logic, the windows service will perform the server side operations and will expose a WCF API to the client , which will handle the GUI related issues.
b. Use an external tool like Service-O-Matic to control your winforms application as if it was a windows service. see:
http://www.kwakkelflap.com/service.html

Testing a silverlight application with statlight on Windows Server 2008 r2

I followed the instructions on pyxis-tech.com to test our Silverlight application on TFS2010 on a Windows 2008 r2 Server. If I run the test as part of a build they all fail. Running them on the server as the same user reveals the following:
------------------ Test Failed ------------------
Test Namespace: [StatLight]
Test Class: [CannotFigureItOut]
Test Method: [NotEnoughContext]
Other Info: A Silverlight MessageBox dialog was automatically closed.
Caption: One or more ActiveX controls could not be displayed because either:
1) Your current security settings prohibit running ActiveX controls on this page
, or
2) You have blocked a publisher of one of the controls.
As a result, the page might not display correctly.
Dialog Message:
Web Browser
-------------------------------------------------
Statlight opens it's browser which displays a dialog with the same error message before closing it after a minute or so. The the browser displays the silverlight installation ad even though the silverlight runtime is already installed on the computer.
I've granted the executing user a ridiculous amount of privileges but still had no success. If anyone has had this problem before, I'd appreciate a little help with this.
You have to make sure the service executing StatLight has desktop interactivity enabled.
On the services Log On tab you have to check the "Allow service to interact with desktop"

Silverlight 4 launch a trusted application into the browser?

I just lost 5 hours looking for a answer which i haven't been able to find :p
First, I'd like to force a trusted application (i need to access the file system) to display into the browser. Based on what i found on google a trusted application must be installed and launched as a desktop application (also called out-of-browser application).
So, i want to have an installed application on the client side but meanwhile, the user must also be able to start this same application into a browser window when he goes on my web site. Is this possible ?
Second, I'd like to give to the user the possibility to start the application from the browser. To be clear, the application is installed on the client computer but i want a button on my web site which starts the desktop application. How can i do that ?
Thanks
The answers are sort of and no.
Yes you can run an application that has been installed on the client also in the browser. However, not all of the installed application features will be available. Anything that requires elevated trust will not work inside the browser.
No you can't launch the installed application programmatically from within code running in the browser. The best you can do is display a polite message to the user to the effect that they have this app already installed and in order to access all of its feature they will need to launch it.
Yes, it is possbile since Silverlight 5, see my answer on silverlight-4-elevated-permission-inside-the-browser

Resources