Manually writing tests

Class library usage, coding and language questions.
vnet
Posts: 29
Joined: Tue Jul 24, 2012 8:13 pm

Manually writing tests

Post by vnet » Wed Aug 08, 2012 12:37 am

I have been writing API automation tests but new to GUI Automation. How would I start writing my tests manually for Win32 app using Ranorex APIs. Do I need to know WinForm (I am a web person)? Apologies if the question looks trivial to most of you here. I just need a head start since I didn't find any tutorial which talks about this issue. Thanks in advance.
V

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Manually writing tests

Post by Support Team » Wed Aug 08, 2012 12:41 pm

Hi,

No, it is not important to know much about WinForms, but if you want to code your tests based on the Ranorex API it would be very helpful if you know how to program with C# or VB.Net.
You wrote you want to write your tests manually, so do you not want to use Ranorex Studio respectively the test suite at all or do you want to use Ranorex Studio, the test suite and just want to use UserCode Modules instead of the Recording Modules?
Did you already take a look at our User Guide and the sections about UserCode Modules?
Lesson 7: Code Modules
Code Examples

Regards,
Markus
Ranorex Support Team
.
Image

vnet
Posts: 29
Joined: Tue Jul 24, 2012 8:13 pm

Re: Manually writing tests

Post by vnet » Wed Aug 08, 2012 8:41 pm

Thanks for the prompt reply.

Since the user code uses values from repository, so in order to 'create' repository with certain values (which doesn't already exist), do I have to record the test case first and then only use those values or their is any alternative to that?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Manually writing tests

Post by Ciege » Wed Aug 08, 2012 10:00 pm

Just a point of clarification... You do not need to use the repository when you write your own code. I for one do not use the repository.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Manually writing tests

Post by Support Team » Thu Aug 09, 2012 11:13 am

Hi,

That is true, but in some cases it is to your advantage to use a repository because it is for instance easier to maintain and it brings lots of functionality.
There is also an alternative, you can use the Spy tool to add specific elements to your repository as it is described in the following links:
Adding Repository Items
Did you know… that you can manually generate a recording?.

Regards,
Markus
Ranorex Support Team
.
Image

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Manually writing tests

Post by artur_gadomski » Mon Aug 20, 2012 9:55 am

I have started by recording some actions using recorder and then reading the Ranorex generated code behind them. But that was some time ago when there were no modules and suites. Now it's a bit more difficult to read the code.

I have made a small sample of Ranorex code for my coworkers see if you can find it usefull. It uses Notepad as a demo AUT and uses both repository and hardcoded paths. It produces nice report with screenshots and snapshots. Simply it does all basic stuff.
Attachments
SampleRanorex.rar
Sample Ranorex Code
(6.94 KiB) Downloaded 286 times

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: Manually writing tests

Post by zator » Mon Aug 20, 2012 12:03 pm

In my opinion if you are going to work with "standard" controls ( like Win-Forms :) ) you do not need to know much about them because Ranorex have some functions to manage with them. However if your applications uses some strange controls it is good to know how they are wotking.

vnet
Posts: 29
Joined: Tue Jul 24, 2012 8:13 pm

Re: Manually writing tests

Post by vnet » Fri Aug 31, 2012 12:18 am

@ artur_gadomski Thanks a lot for the sample app. Had a question, how did you create the rxep file. when I tried creating one it gives me a cs file (using Visual studio C#). Is there any other way of creating one?

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Manually writing tests

Post by artur_gadomski » Fri Aug 31, 2012 8:16 am

I used Spy. Tracked controls I wanted and then added them to repository. Then save and export to C# code. Add both files to Solution. Repository file is included in Solution for keeping all the files together and is not actually required. But once you change default program to use to open it to Spy, then you can easily edit your repository almost without leaving Visual Studio.

vnet
Posts: 29
Joined: Tue Jul 24, 2012 8:13 pm

Re: Manually writing tests

Post by vnet » Fri Sep 07, 2012 10:06 pm

@artur_gadomski Got it. Thanks for the sample code, it worked and was very useful.