frobot framework - Usage outside testing - automated-tests

I recently learned how to use robot framework - a testing framework for software / web app testing. It has very simple strong expressive syntax.
I wonder if there is possibility of any other usage of robot framework than testing - I could imagine to create some kind of scraping bot, or checking bot. But so far it looks to me, like it is created strictly for testing (basically whole logic you write in testcases).
So my question:
Can robot framework be used outside testing? If yes, can you provide any resources / examples?
Feel free to share any personal experience with this.

Yes, robot can be used outside of testing. Robot Framework version 3.1 added preliminary support for RPA (robotic process automation). Instead of tests, you can create tasks.
See Creating tasks in the robot framework user guide for a bit more information.

Related

Custom FxCop rule - Integration tests?

I've got a FxCop custom rule and I need to be able to create a integration test. I'm however having a hard time finding decent examples regarding this, since MS changed the API. Osherove's FxCopUnit looks like the perfekt framework, but it also relies on the old FxCop API - Any thoughts?
True unit testing of FxCop rules isn't necessarily worth the investment necessary to build a proper unit testing framework for rules. Too much depends on the data and logic provided by the FxCop engine itself for the dependency to be mocked without introducing potentially serious deviations from behaviour of the actual engine. Most folks who test rules run mainly integration tests (including FxCopUnit, despite its name).
If you feel that an integration testing framework for FxCop rules would be useful, there is one included in the Bordecal FxCop rules framework. Documentation for its use is in the "The rule testing framework" section at http://bordecalfxcop.codeplex.com/documentation.
I've also rolled a custom FxCop testing framework based on Roslyn CTP. You can find it in the FxCopContrib project at http://FxCopContrib.codeplex.com/
Just get the latest version of the sources to get it.

What language can be used to automate web test?

I'm working on a Web Service which is associated with a form that requires inputs from user. The problem is the fields are quite large, approximately 200 fields need to be filled in. I would like to ask what language would serve best in this case, in term of automating inputs.
I tried Ruby with Watir, but it doesn't work as expected when dealing with iframe. So I'm looking for an alternative solution. Any feedback or suggestion would be greatly appreciated. My WS is developed using ASP.NET and Java Script.
Thanks,
Chan
Selenium may provide the functionality you're looking for. It is a testing framework that supports recording tests, so writing scripts is optional. It does however provide scripting functionality in a variety of languages, including Java, C#, Ruby, Python and more.
Have you tried WatiN? It is an open source automated test framework for Web application. And it support C# and other managed languages.

How Testing relates to ASP.NET MVC/WEBFORMS Silverlight MVVM

Ive been learning MVC2 and MVVM lately and I think it works like this.
ASP.NET MVC2 - Can test the whole web site using unit tests
ASP.NET MVC2 + jquery web service calls - Can no longer just use MSTest unit test. What is the MS product to test the javascript side?
ASP.NET Webforms - Unit Tests are near impossible when the coder doesnt create the Webforms site with Testing in mind. Therefore Asp.NET web performance tests are the closest thing to testing that is realistic. Coded UI Tests are too trivial to really be useful for things like ASP.NET validators.
ASP.NET Webforms + jquery web service calls - Can only unit test the web service calls. Cannot use Web Performance tests because of javsscript calls. Need some sort of javascript testing framework.
Silverlight - No tests. Maybe Coded UI Tests.
Silverlight MVVM - Use silverlight unit test framework to test ViewModel similiar to MVC.
Silverlight MEF - How does MEF affect testing scenerios if at all ?
Is this accurate? Is there anything I am missing ?
I am trying to make a argument to the people in charge that we should use MVC over Webforms so that we can create automated testing. As it is we are doing Webforms all in one project and impossible to test so people just test off of manual scripts :(
Rather than specifying the reasons why you should use MVC over Webforms, I'd take a step back and sell the management team on why you should use unit tests. After that's sold you have a case of saying that MVC would allow you to do this more efficiently than webforms.
Are you looking at going the full TDD route, or just creating tests after? I'd highly recommend going down the TDD path even though it does have a steeper learning curve and will lessen your productivity while you are learning it.
Since you are already looking into testing, you probably know most of these, but I'll re-iterate some of the benefits:
Less defects get through to QA.
Tests can be created for issues that QA and customers find.
Designing for testing creates a more loosely coupled application which tend to be more maintainable.
Increased developer confidence when making changes leading to sustained productivity as the application code base matures.
Tests are great documentation for new developers joining the project, as they can see what's trying to be achieved.
Note: the cost of fixing a defect that has made it through to production can be up to 80 x the cost of finding and fixing it in the development and QA process (I'll try to find my source for that figure).
Unit testing is only one piece of the puzzle though, you'll also want to look at using a Continuous Integration server such as CruiseControl.NET to automate your builds and tests. This will make sure that everyone keeps the build in a working state.
For an existing Webforms project you might also want to look into the Web Client Software Factory. I've found it to be very useful for migrating legacy webforms apps over time, though it's a little more convoluted than MVC2.
I don't know about other technologies, but I can talk about using Silverlight with MVVM pattern. Using MVVM pattern along with command pattern, we have been able to unit test all of our C# code. I mean barring xaml code, we have a very high code coverage for our C# code. We actually use a modified version of MVVM wherein we also use a controller. If you ensure that you have no code in code-behind files, you can simulate button click/other such UI events. This is very useful for integration tests. We have found out that our pattern of MVVM along with controller and using command pattern facilitates unit testing.

How apply Unit tests in ASP.NET webforms

I'm developing a website in asp.net webforms with 3 layers; UI, BLL and DAL
The website is already developed, but i like have more control about the unit tests of each form
Pass specific values at specific inputs for i see, if application survives or not.
I already study about NUnit but in webforms in UI layer how can apply these tests?
What i wnat is get some way to test UI (validations) without have to access to the BLL as i was an user.
I'm trying to add the Unit tests to my app but i not sure how to do it!
somebody can help my small-bigger problem?
You can add unit test to your UI using one of these tools
http://watin.sourceforge.net/
http://seleniumhq.org/
With both tools you can generate C# or VB classes that can be used by NUnit.
IMHO, UI test are not as reliable as the common unit tests. Bacause timing conditions you may randomly find that some test will fail.
I used both tools and I recommend selenium mainly because you can generate test that can be run against any browser.
Here an example how to use Watin with NUnit
http://www.codeproject.com/KB/applications/SimpleUITestHarness.aspx
And here a guide how to use Seleniun with Nunit
http://www.lostechies.com/blogs/agilecruz/archive/2009/02/10/how-to-configure-selenium-rc-for-use-in-c-nunit-tests.aspx
If I understand your question correctly, you're asking how to automate testing a WebForms UI. If I misunderstand, please correct this understanding.
Frankly, I don't think there is a good answer out there for this. There are two options, however, that work okay:
Visual Studio Test Edition
Telerik's Web Testing (both a free version and a version with a cost)

How do I automate build and testing for an asp.net ajax application in Team Foundation Server?

Q. We're looking for a way to automate
build process, run test cases and
store build results.
A problem could be raise as the application on which we want to setup this process is an ajax application -- a one page operation application highly rely on JavaScript. The QA team is using QTP to automate their testing.
Q. Now as we're moved to Team Foundation
Server we would like to be in the box
instead to use some other tool for
functions that can also be done in
Team Foundation. Will it a good choice to use Team Foundation instead
of other tool for defining test cases.
Once, they adopt and will generate test cases for the app.
Q. We would like to attach the test
cases with the daily build and also
like to have log/report for monitoring
build progress.
This, I assume, but you can also suggest a practice which can make the aforementioned process more effective and quick.
Thanks.
TFS has a built in test runner but it is aimed at MSTest. What test framework are you using? TFS uses MSBuild in the background and has a template build script with hooks to allow you to customize the process. Read up more about it here.
There is an TFS Web Test but I haven't looked into it much there is nothing stopping you hooking in some open source framework like Selenium into the build process
3.TFS keeps a log of all the builds done much the same as CruiseControl would.
I would recommned "Team Foundation Server 2008 in Action" as it is a very good book that explains a lot about TFS.

Resources