Run VisualStudio classes (unit tests) from Excel? - excel

Might be a silly question, but: Is it possible? For example, click a button in Excel that runs a specific C# unit test in VS, preferably also sending some info from Excel, and possible getting back the result of the run.
I've been doing this a lot in HP QTP/UFT, for running test cases. Now I'm using Selenium in C#/VS, and was thinking maybe there was a way to "streamline" it here too.
I'm using VS 2013 Express, btw - if there are possibilities for this, I realize they might be limited or non-existant in the Express version.

There is no standardized feature in any edition of Visual Studio that does this. One could build a plugin for Excel that does this. The Visual Studio Test Runner is a simple executable and it can output a XML file with the test results or you can attach your own logger (/logger) from the command line.
VSTO allows you to write a plugin for Excel that can execute C# code. Running the test runner and parsing the results from C# code should be relatively straight forward.
To populate the list of available tests, you can use /ListTests.

Related

how to generate excel vba code in selenium ide

I am using Selenium IDE 2.9.1 (a Firefox plugin) to get web element. I am unable to see VBA code when I go to options > format. Does anybody know how to get or set VBA source code?
This is the info from the documentation. This seems to imply format VBA is not a supported feature.
Format
Format, under the Options menu, allows you to select a language
for saving and displaying the test case. The default is HTML.
If you will be using Selenium-RC to run your test cases, this feature
is used to translate your test case into a programming language.
Select the language, e.g. Java, PHP, you will be using with
Selenium-RC for developing your test programs. Then simply save the
test case using File=>Export Test Case As. Your test case will be
translated into a series of functions in the language you choose.
Essentially, program code supporting your test is generated for you by
Selenium-IDE.
Also, note that if the generated code does not suit your needs, you
can alter it by editing a configuration file which defines the
generation process. Each supported language has configuration settings
which are editable. This is under the Options=>Options=>Formats tab.
Note
At the time of this writing, this feature is not yet supported by the
Selenium developers. However the author has altered the C# format in a
limited manner and it has worked well.

Pass parameters to crystal report automatically and export to PDF

I need to run a crystal report which requires one parameter multiple times. Is there any way to automate running this CR report for a set of different parameters and exporting each report to pdf?
I was thinking of using excel vba but not sure if this is possible and also don't know how to write codes for it. I'm using CR XI but don't have the developer environment installed.
I've looked all over the internet for several days but haven't found a feasible solution.
Any inputs would be appreciated! Thanks.
You could fork my PsCrystal project on GitHub and add the missing functionality. It's a PowerShell wrapper of the Crystal Reports SDK.

Group tests by class & namespace in Test Explorer

In Visual Studio 2010, I could list my tests by full name. That way, my tests would be sorted by object, then method, then individual test case when I structured the tests as shown here:
http://haacked.com/archive/2012/01/02/structuring-unit-tests.aspx
However, in Visual Studio 2012 Ultimate RC Test Explorer, it lists the tests by test name (instead of "WidgetMaker.ctor.HappyPath", it just shows "HappyPath"). Is there a way to change the Test Explorer to show full names instead of the test name? Thanks.
Here is the answer in the end of the post :
http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx
So, wait and see/hope...
EDIT : In the mean time, you still can have a similar interface by openning the *.vsmdi file in your solution items.

Issue search and excel export for JIRA, outside JIRA

I'm looking to download a list of issues from our JIRA issue list, to process further in VBA and generate a report from the issue list. I want this process to be automated from start to end so e.g. I run a java or VB or C# program, which does a search and download from JIRA (somehow) then runs a VBA program to extract and format the issues into a report. Is there anyway this can be done? I'm using JIRA 3.13.
I've looked at the JIRA and Atlassian plugins but don't quite understand how they work. Aren't plugins meant to be deployed into the JIRA instance. I don't see how plugins can achieve what i want to do.
You'll likely want to use the JIRA SOAP web service via a SOAP client in your program. This can call the getIssuesFromFilter method to return the results of a filter. Then generate the csv file for Excel to import or whatever you want.
Better Excel Plugin was exactly designed for these type of usage.
You can export your issues to a worksheet, then instruct the XLS template to process them using the Excel tools, like formulas and functions, charts, pivot tables and pivot charts, to produce full blown reports. It is fully automatic and the report can be generated by a single click.
If you look for automation, like generating and emailing the report periodically, or generating and saving the report when an issue event occurs, the companion add-on Excel Automation Plugin is super useful.
Here is a sample report to give you an idea about the capabilities:

Can I use RegFree Com with an application written in Excel VBA?

I have an application that is written in Excel VBA, myApp.xls. Currently we use InstallShield to distribute the application. Since we are moving to Windows Vista, I need to be able to install the application as a standard user. This does not allow for me to update the registry during the install process. In addition to the excel application we also have several VB6 applications. In order to install those applications, I was able to use RegFree com and Make My Manifest (MMM) as suggested by people on this forum (I greatly appreciate the insight btw!). This process, although a bit tedious, worked well. I then packaged the output from MMM in a VS '05 installer project and removed the UAC prompt on the msi using msiinfo.exe. Now I am faced with installing an application that basically lives in an Excel file. I modified a manifest that MMM created for me for one of my VB6 apps and tried to run the excel file through that, but I did not have much luck. Does anybody know of a way to do this? Does RegFree com work with VBA? Any thoughts or suggestions would be much appreciated.
Thanks,
Steve
Yes, it is possible to use registration-free COM through VBA, on Win2k3+.
Fundamentally, reg-free says "this COM class no longer needs to be registered to be discoverable, instead registration info will be carried by a manifest".
Manifests themselves are implictly referenced by executables when they are embedded in the executable, or named *.exe.manifest.
However, in the case of VBA -- your code doesn't live in an executable you control, so you need another way to get a reference to the manifest.
That's where the Microsoft.Windows.ActCtx object comes in - it specifically allows you to instantiate your object given an explicit manifest reference.
For example (in JS, since I'm rusty on VBA syntax):
var actCtx = WScript.CreateObject("Microsoft.Windows.ActCtx");
actCtx.Manifest = "myregfree.manifest";
var obj = actCtx.CreateObject("MyObj");

Resources