Silk4Net & Silk Workbench integration - silktest

Is it possible to call scripts written in Silk4Net from Workbench? We are at the beginning of building an automation framework using SilkTest, and want to be able to express it to both our testers and developers.

No, unfortunately this isn't possible. You can call .NET Scripts from visual tests within the Workbench, but you can't call scripts between the various Silk Test clients currently.
Update: Reading your question again, it sounds like you just want some common code to share between scripts written in the Workbench, and scripts written in Silk4NET. If this is your goal, you could accomplish this by doing the following:
Create a new Class Library project in Visual Studio. It should target .NET 4.
Add a reference to SilkTest.Ntf to this project (this is the assembly that contains all of the automation classes used by Silk4NET and .NET scripts in the Workbench).
Put any common code into this assembly.
You can then reference this assembly from both your Silk4NET project and from .NET scripts in the Workbench.

I contacted Silk support today. Their reply is: "unfortunately there is no way to call the Silk4NET scripts in SilkTest Workbench. This is due to the fact that Silk4NETs scripts are built using the 4.5 .NET framework and Silk Test Workbenchs scripts are built using .NET 4.0. If you try to reference your assembly and call your methods and classes it results in compilation errors."

Related

Using dotnetbrowser in a WinForm via Com Interop?

We have an application where the main UI is coded in vb6. We also have multiple .net assemblies (winform and class libraries) built in vb.net (VS2015, targeting framework 4.5.2).
Can we utilize the winform dotnetbrowser in a .net assembly that is called via com interop from our vb6 main app?
The licensing articles instruct adding the license to the project as an embedded resourse - would this license be added to the .net assembly as an embedded resource? Or would it need to be added to the main app exe (vb6) as an embedded resource there?
Can we utilize the winform dotnetbrowser in a .net assembly that is called via com interop from our vb6 main app?
Yes, this use-case is possible.
The licensing articles instruct adding the license to the project as an embedded resourse - would this license be added to the .net assembly as an embedded resource? Or would it need to be added to the main app exe (vb6) as an embedded resource there?
There are several ways to provide the licence to DotNetBrowser:
the most common and recommended way is to include the licence into
the application .NET assembly as an Embedded Resource (it is
usually done when performing a build)
the other common way is putting
the licence file into the working directory of the application that
loads and uses DotNetBrowser
at last, you can specify the full path to the
licence file using the DOTNETBROWSER_LICENSE_PATH environment
variable

Coded UI Testing of Silverlight in Sharepoint 2010

I am creating a Coded UI test for our system which runs on Sharepoint 2010. Part of the test sequence is creating a site; Sharepoint's UI for creating sites runs on Silverlight. Therefore, I need to create a Coded UI test for a Silverlight component which is part of out-of-the-box Sharepoint rather then part of our application. When I try to record a test, I get the following message:
No Silverlight controls where detected. Verify that the application under test is built using Silverlight assemblies with a version of 4.0 or greater and that a reference to the Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll assembly has been added to the project. For more information, see http://go.microsoft.com/fwlink/?LinkId=204562
I have two questions:
1) How can I find out the Silverlight version which Sharepoint components are built against? If they are built against Silverlight version 3.5 or earlier - I suppose the problem is unresolvable?
2) Assuming the previous question is answered - how can I make Sharepoint's Silverlight components reference the SilverlightUIAutomationHelper.dll library? That seems problematic at best to me...
Silverlight version installed on the test machine is 4; Visual Studio Feature Pack 2 is installed.
Thanks.
You can't make SharePoint's Silverlight components reference the automation helper library unless you have the source code and can recompile them. So the answer to your first question doesn't really matter.
You could modify Sharepoint XAPs to simply add Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll in there. You don't really need the code itself to reference it, it just has to part of the package. The XAP file is just a zip file so you should be able to modify this.
You will have to find where Sharepoint is getting the XAPs from and change the source (obviously you don't want to do this in prod boxes and there's even a license restriction for the Automation dll that prevents you from do it). You could also write a Fiddler AutoResponder to modify the XAP file and add the dll before it gets to the browser. For an example of this have a look at this AutoResponder:
https://bitbucket.org/mamadero/hackingsilverlightdemo/src/2fecb7b59dec/FiddlerAutoResponder

Script-Run Silverlight Test Project

I have a solution with several Silverlight Test Projects. I would like to have some kind of script or tool with the ability of running all these test projects and generating some kind of report (any simple output will work)
I googled around for some time but I was unable to find any existent solution other than running the projects one by one from Visual Studio.
Has someone came across this situation before? Any idea on how to implement such a tool?
Regards
If you need automated testing then Test Manager is a tool from Microsoft. http://www.microsoft.com/visualstudio/en-us/products/2010-editions/test-professional/overview
http://msdn.microsoft.com/en-us/library/bb385901.aspx
and use with silverlight
http://jugalpanchal.blogspot.com/2011/09/configure-test-manager-for-silverlight.html
Use StatLight! http://statlight.codeplex.com It's a Silverlight Test Project runner exe that you can invoke from the cmdline. Its great and can be integrated into TFS Workflows as well as Msbuild.

WPF embed .net libraries into exe file

Is it possible to embed all .net dependencies to the final exe file because I want it to run on every windows machine even without preinstalled .net?
Use ClickOnce, and setup the dependencies, so that it installs the prerequisited .Net framework.
ClickOnce is good for dealing with the deployment of your application.
To embed all .net dependencies you can use ILMerge or, even better, this approach by Jeffrey Richter (which is recommended from inside the ILMerge website too).
I am not sure about the lagality of this but you can possibly use reflection to get the code from the parts of the .NET framework which you are using and re-create them as your own classes. Then use those classes when building your application.
Edit: I am not sure that you can reflect the entire .net framework though.

Best Practice for Obfuscating a C# Visual Studio DSL Solution as VSIX

I was wondering if anyone has any advice for obfuscating a DSL?
Background - We have created a DSL which we will putting into the Visual Studio Gallery as a VSIX file.
We already use dotfuscator for our obfuscation on other projects but I would like to know if there are any best practices or issues when packaging a DSL for deployment as a VSIX
Disclaimer: I am a developer at PreEmptive Solutions, the makers of Dotfuscator.
As long as your DSL assemblies are managed code you can use Dotfuscator on them. The 4.6.1005 release of Dotfuscator Professional provides support for .NET 4.0 Beta 2 assemblies. As long as your support contract is current, PreEmptive will provide support in the event you run into any issues.
The only external process you will need to implement is one to update your VSIX file either manually or via a script that will replace the unobfuscated assemblies in the original VSIX with the obfuscated ones output by Dotfuscator. See http://blogs.msdn.com/quanto/archive/2009/05/26/what-is-a-vsix.aspx for details on the structure of a VSIX and how to work with them.
While the 4.6.1005 version of Dotfuscator has been significantly updated to accept and emit XAP files, ClickOnce manifests and directories we have not yet implemented the ability for Dotfuscator to natively process VSIX assemblies. I have put this enhancement on our request list :) .

Resources