Integration of automated testing in hudson using selenium framework - c#

I'm new to web development and web testing. And I want to use Hudson in my continous integration and for my automated testing using selenium. How can I integrate the selenium in hudson, so that everytime I build using hudson, it will automatically execute the automated testing in selenium? What application should I install? By the way I'm using ubuntu as my OS.
I'm building my webapp using asp.net and C#.
Please advise.
Thanks.

You would invoke the tests like you would for your normal unit tests. Assuming that you are creating your tests to be run with NUnit then you will need to make sure that that is installed.
Setting up your Selenium project, like a normal class library project, that builds a dll that can run your tests should suffice.

You can Integrate your Selenium-TestNG/Nunit Framework with Maven, Maven build path you can give in Jenkins/Hudson.

Related

Run Angular from C# - NUnit testing

In the solution we have an API, Angular app and NUnit tests project. I have the task to test the UI of the angular app from NUnit test. Is there a way to run angular app from the setup of the test?
You can use Selenium WebDriver for those purposes. If it is configured correctly, you will be able to open a new web browser inside your NUnit test and check the Angular app there.

TestRail integration with selenium using c#

I am new to TestRail tool and wanted to integrate all my UI Selenium automation test cases with TestRail. I have gone through the API Bindings of TestRail but they are only meant for API test cases. Can someone please please give me any idea to integrate TestRail with selenium using c#.
What you would need to do to integrate it is to set up your test run as part of your set up code when you are running your Selenium tests.
There is a Nuget package that will allow you to integrate with Testrail if you are using the original test suite project style from Testrail.
https://github.com/zoosk/testrail-client
I've created an example project of a simple Selenium + NUnit + Testrail integration here:
https://github.com/shortstacked/SeleniumTestrailIntegration

Perform unit tests on published web-api

I would like to perform automated unit tests on my web-api project after publish it on IIS but I don't know how ? I can launch tests in Visual Studio, no problem for that.
I have some unit tests in a different project, must I generate the unit tests project an deploy it in the api-web site, and use another soft to perform tests ?
Thanks for your response.
Firstly, what you are proposing here does not sound like Unit tests. They are integration tests that test the entire integration and end to end working across application layers.
Regarding the automated execution, you can easily set that up using CI/CD. You can use VSTS or TeamCity like solutions to run your test cases at a particular schedule. Or, you can run your tests using command line from a system, that has Visual Studio installed.

Referencing Silverlight UI Automation Helper dll in CodedUI Test

I am trying to automate a Silverlight web application using CodedUI. The application under test is already developed and deployed in our testing environment.
I tried automating using record feature of CodedUI but was unsuccessful in getting the recorded actions. On googling, I found that I have to install this plugin: https://visualstudiogallery.msdn.microsoft.com/28312a61-9451-451a-990c-c9929b751eb4
I did the installation and still was unable to record. Then I found that I have to reference Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll file in the Silverlight project.
This is where I am stuck. I am not sure whether to reference this file in :
The project which was used to develop the Silverlight application
The CodedUI test project.
If it is option 1, I don't have access to the development project. Is there any workaround for this ?
I am pretty sure you only have to reference it in the Coded UI test project. This is how I do it with the DevExpress.CodedUIExtension helper DLL.
Personally I would put the test code next to the application code though, when you version the tests with the application this will make it possible to run tests against a previous and or branched version.
Yes,You need to Refer the AutomationHelper.dll in The project which was used to develop the Silverlight application. I was having same issue way back refering to dll will solve the purpose.
In addition you can refer it with flag to make sure this will not go to production which is a best practice.

Framework for running automated acceptance tests after build?

In my current project we are using a TFS Build server for continuous integration (build + run unit tests). We also have a set of automated acceptance tests written as SpecFlow features.
However, these are not integrated into the continuous integration workflow. Today, the application is deployed manually and the acceptance tests are invoked manually.
We would like to automate this in the form of a script/console application or some kind of existing CI tool.
This is what we would like to do periodically, e.g. once every hour:
Ask TFS if there are any new builds
If yes: get the latest successful build from TFS
Deploy the application to our test machine
Execute the SpecFlow tests against the deployed build
Collect the result and present it on some form of web page
Are there any existing tools or frameworks for this? I have read about existing CI servers but they doesn't seem to fit my description. If not, any advice on how to achieve step 1, 2 and 5 programatically or by using command line tools?
In my humble opinion TFS is capable of doing everything that you listed without involving any additional tools. What you might need to do is to setup a Lab Environment and use specific Workflow build definition to achieve it. You need also Test controller and test agents.
The easiest way might be to setup Standard Lab environment which might act in this way -
Build - Deploy - Test workflow
Build got triggered, then got deployed into the lab environment (might be a bunch of either physical or VM machines with installed test agents on them and connected to the Test controller), after that all test are executed and the result is consolidated as a part of the build results.
Hope this helps a bit!
-Rado

Categories