Idiot level instructions on how to use dotCover with Silverlight4 app?

I can't find instructions for how to set up dotCover to run code coverage on a Silverlight 4 app?

Also can I use dotCover to generate results when a browser is run by an external automated test tool?

0
22 comments
Avatar
Permanently deleted user

Am I going to get an answer to my question???

0
Avatar
Permanently deleted user

I found this snippet of information, but still cannot get it to work :(

http://confluence.jetbrains.net/display/DCVR/How+to+cover+Silverlight+code+with+dotCover

I'm kinda confused by how exactly this works?

1) I have a SL 4 application. Let's call it 'MyApp'.

2) I have a test application with lots of unit test. Let's call this 'TestMyApp'.

3) I have the IIS test folder. Let's call this 'TestMyApp.Web'.

Following the example above I choose 'cover application' and paste in the URL I get from the Browser when I run the app normally, correct?

OK, so far so good.

What PDB and DLL are we talking about here?

I've tried the 'MyApp/obj/Debug', 'TestMyApp/obj/debug' and 'TestMyApp.Web/obj/debug' and nothing works.

Can you please give some clearer examples?

I need to make a recommendation on a code coverage tool and would require 200+ licenses, but I cannot do so if I cannot get it to work :(

Thanks

ET

0
Avatar
Permanently deleted user

In my case I have no unit test. Instead I'm using a QA GUI test replay tool to run through a set of scenarios.  I'm using  the 'dotCover/Cover application' menu item to start the URL that includes the Silverlight page. At that point a dialog pops up showing various snapshot options. However, when I exit the test app nothing is available - none of the C# classes show any code coverage.

0

Davout, Colin,
Here are some comments:

Symbol search path is the path to the pdbs of the assemblies being tested.
In order to attach our profiling engine correctly web browser should be started from the dotCover.
(e.g. dotCover -> Cover Application -> Silverlight application)
Please note that if your automated test tool opens another instance of the browser, it should not be in a separate process (expected to be in the same process or in subprocess)
After you finished working with the application, "get snapshot" and "kill process" should be called in the controller window.
Coverage results window will be opened.
If results differ from the ones you've expected, you can try the following:
- check coverage filters (they can exclude some code)
- disable 'Math with current solution structure' option in the coverage window toolbar (by default dotCover tries to match assemblies in the report with projects from your current solution, disabling this option will show list of all assemblies)

@Colin:
Could you please tell which unit testing framework do you use for your silverlight tests?
And how does your development environment configured? This will help to provide more details.

0
Avatar
Permanently deleted user

For the moment I'm trying to validate the code coverage tool by exercising some of the main page options myself interactively.

My sequence of actions is as follows...

  • Select the 'dotCover/Cover application' menu item
  • When the 'select application dialog appears choose 'Silverlight' and then hit OK
  • Enter the silverlight app page URL http://localhost:56001/SLTest01TestPage.aspx
  • The browser page is opened. I make a few user actions.
  • I then select 'get snapshot' from the dotCover popup form
  • Then I select the 'kill' option from the dotCover popup form
  • After that the focus returns to TFS where the dotCover code coverage reports view appears, but the only C# class in this simple test app shows zero code coverage

If I can get this to work my aim would be to use the 'eggPlant' QA tool to run the test process.  I can link to this tool by creating a 'generic' test project inside TFS and using a command line to kick off a process that launches a browser.

I've uploaded a screenshot of the dotCover code coverage report view.

As I'm fairly new to TFS - are there any debug settings I need to set inside the TFS project for dotCover to work?



Attachment(s):
dotcover1.png
0

It looks like PDBs for the silverlight assemblies were not found.
Have you specified path to the PDBs as described on the screenshot?
http://confluence.jetbrains.net/download/attachments/36021360/2010-09-06_124925.png

0
Avatar
Permanently deleted user

What is this path relative to the project folder?

for instance I have my project under the folder...

     \documents\visual studio 2010\projects\SLTest01

that's the folder name I'm putting into the dialog, right?

0

This should be an absolute path to the folder containing actual PDB-files.
(e.g. c:\path_to_the_project\bin\debug)
It's possible to specify several folders. In this case they should be separated with the semicolon.

0
Avatar
Permanently deleted user

I set the debug path to...

    SLTest01\SLTest01.Web\bin

.... and nothing happens. I get zero coverage.   

As I my test app is tiny - one noddy form backed by one simple C# class - I've uploaded the project as an attachment.



Attachment(s):
SLTest01.zip
0
Avatar
Permanently deleted user

I still cannot get it to work :( I've pointed at a local instance of the application and one on a remote server and pointed to the 'obj' folder that contains the PDB for the application and the application.Web folder. Nada :( Please give us some clearer guidance on how to do this... Thanks ET

0
Avatar
Permanently deleted user

I got it to work :)

I didn't read your instructions correctly.

It's the PDB and DLL for the items to test.
Since my MyApp actually uses a .NET class library I created, I needed to point to it's PDB folder, not the final application.
All is working good now.

Thanks

ET

0
Avatar
Permanently deleted user

No change for me....

I've tried setting my SLTest01 project as the start up project and then use the 'dotCover/Cover start up project' and I get even less info -  my single C# class doesn't appear in the coverage report.

0
Avatar
Permanently deleted user

It works fine with your source code for me :)

You need to point the PDB source at:

\SLTest01\SLTest01\obj\Debug

HTH

ET



Attachment(s):
docover.PNG
0
Avatar
Permanently deleted user

Thanks...  that's solves it.

Very nice.

It would be good to have an option where I could right click over a solution/project and activate dotCover that way.

0
Avatar
Permanently deleted user

You will be able to very soon using Version 0.2 of AgUnit.
It's currently broken with the latest version of ReSharper 5.1.1, but I emailed the author 2 days ago and he says he is litteraly a couple of days away from releasing version 0.2 :)

HTH

ET

0

I'm glad to hear that everything works well now.
Regarding AgUnit: we had a conversation with Steven two months ago and I've provided him all info required for the seamless dotCover integration.
I have no info about current progress in this direction, but hopefully v0.2 will work fine with dotCover.

0
Avatar
Permanently deleted user

Thank you - this is very helpful. I can now measure code coverage if I start my app from the dotCover menu in Visual Studio, and use the browser that dotCover opens to do manual testing.

What I want to know is how can I use my automated tests, which run Selenium via NUnit - how can I get them to run "in the same process" as dotCover?

1. I open my ASP.NET project in Visual Studio.

2. I use the dotCover menu item "Cover Startup Application"

3. This starts my app in Cassini on a specific port.

4. I go to another Visual Studio instance and open my automated test project. (Clearly this is not "in the same process" as dotCover, so I know it will not work, my question is what do I need to do instead?)

5. From there I run my NUnit tests which use Selenium and open browers - I set them to use the same port as my app is running on Cassini. 6.

6. When my tests are finished, I go back to the original visual studio, where dotCover is running, and click Get Snapshot and Kill Process.

7. My code coverage is zero.

What should I do instead?

Thanks in advance,

-Kay

0

Hello Kay,
There is else one way to analyse your automated tests.
You can use "dotCover -> Cover Application -> .NET Process".
It will analyse all .NET processes started after you will click "OK".
Also make sure that "Profile Silverlight applications" option is turned on.

0
Avatar
Permanently deleted user

Hi Ruslan, I am trying to use dotcover for Silverlight code coverage for manual testing and did follow the discussion/suggestions above but still didn't get any results. I am starting the the dotcover from VS10 after opening the sln file and cover silverlight application, even pdb file path is also mentioned correctly.

C:\MRAT_NG\UI\MRAT_NG.Web\obj\Debug


0
Avatar
Permanently deleted user

Hi Ruslan, I am trying to use dotcover for Silverlight code coverage for manual testing and did follow the discussion/suggestions above but still didn't get any results. I am starting the the dotcover from VS10 after opening the sln file and cover silverlight application, even pdb file path is also mentioned correctly.

C:\MRAT_NG\UI\MRAT_NG.Web\obj\Debug


0
Avatar
Permanently deleted user

Hi Ruslan, I am trying to use dotcover for Silverlight code coverage for manual testing and did follow the discussion/suggestions above but still didn't get any results. I am starting the the dotcover from VS10 after opening the sln file and cover silverlight application, even pdb file path is also mentioned correctly.

C:\MRAT_NG\UI\MRAT_NG.Web\obj\Debug


0

Hello Vamshi,

Please try to point the PDB source at: C:\MRAT_NG\UI\MRAT_NG\bin\Debug and let me know if it doesn't help.

Regards.

0

Please sign in to leave a comment.