473,802 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

self-running C# desktop app?

I have a C program that analyzes data. It makes tables,
graphs, other output in response to user selections.

It normally takes keyboard input into a curses-based user
interface. However, it can also run itself, forever or
until it crashes. For self-run, "input" is based on random
numbers. The self-run is useful for testing (and fun).

I'm porting the program to C#. It will have tab controls,
buttons, menus, dialog boxes, list boxes... Any ideas how
to do this kind of self-run mode for a C# desktop app?

Not looking for advice about structured testing, random #
generation, other basics. :) I'm looking for info about
automated testing like this in C# desktop app. I write
code in a text editor.

Thanks,
Daniel Goldman
Nov 15 '05 #1
1 1724
Hi,
I am totally lost what you want, but :)
I guess you can always trap the events generated by different controls and
rise some flags and check them if the program is ready to accept next input.
This is in case that you want to simulate a real user input. If you want to
see what will happen if user just make random clicks and inputs ... hmmm,
brute force is the name :)
And also, I do not thing that you need to simulate mouse clicks and key
presses (I assume that this is well implemented in the framework), and you
want only to see the result of any different combination of inputs (i.e.
what happens if checkbox1 is selected, textfield1 contains "blabla" and user
clicks OK button). So, in your timer thread you may set a flag that it is
not finished yet, set these controls to testing values and invoke the click
event of the button. And when the corresponding operation of the click event
finishes, just set the flag back to show that the test thread can be run
again. Just create the threat in static class, and lock it while it is
executed, so you will not have 2 simultaneous executions.

Sunny
"Daniel Goldman" <hh******@yahoo .com> wrote in message
news:69******** *************** ***@posting.goo gle.com...
Thanks for response, it's a step in right direction, even
though basic problem remains. I think the thread needs to:

1) generate random number
2) make event happen, based on number
3) wait for program to respond, then back to 1)

On step 2), naive brute force way might be the thread somehow
generates mouse clicks and keyboard events. By itself, probably
won't work. GUI events need to know about sending control, and
be linked to called object. Right?

Also, brute force might fail to fully run program. Some sections
might fail to execute. Most mouse clicks "miss the mark".

A more realistic way might be fire events specifically tied
to controls on the interface. Maybe some way to register all
controls with a central class, by implementing an interface.
The central class could know which part of the program was
currently in operation, and adjust how it generates events.

Another possibility - A separate program generates mouse
and keyboard events on the interface. This is similar to
brute force method. Problem is - how would it know to wait?

Step 3) wait is required so sequence is repeatable, each self-run
based on a seed is the same. I've glanced at lock, Pulse(),
and Wait(), which should work and be better than Timer, since
some operations just take split second, others many seconds.

Daniel Goldman

"Sunny" <su******@icebe rgwireless.com> wrote in message

news:<OX******* *******@TK2MSFT NGP10.phx.gbl>. ..
Why don't you try to start a separate threat to generate inputs? Just for fun :)
You may start it as timer event as an example.

Sunny

"Daniel Goldman" <hh******@yahoo .com> wrote in message
news:69******** *************** ***@posting.goo gle.com...
I have a C program that analyzes data. It makes tables,
graphs, other output in response to user selections.

It normally takes keyboard input into a curses-based user
interface. However, it can also run itself, forever or
until it crashes. For self-run, "input" is based on random
numbers. The self-run is useful for testing (and fun).

I'm porting the program to C#. It will have tab controls,
buttons, menus, dialog boxes, list boxes... Any ideas how
to do this kind of self-run mode for a C# desktop app?

Not looking for advice about structured testing, random #
generation, other basics. :) I'm looking for info about
automated testing like this in C# desktop app. I write
code in a text editor.

Thanks,
Daniel Goldman

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4730
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e = IntVar() for part, list in info.masterList.items():
15
2600
by: Ralf W. Grosse-Kunstleve | last post by:
****************************************************************************** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html ****************************************************************************** Hi fellow Python coders, I often find myself writing:: class grouping:
18
2290
by: Ralf W. Grosse-Kunstleve | last post by:
My initial proposal (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't exactly get a warm welcome... And Now for Something Completely Different: class autoinit(object): def __init__(self, *args, **keyword_args): self.__dict__.update(
4
2798
by: David Coffin | last post by:
I'd like to subclass int to support list access, treating the integer as if it were a list of bits. Assigning bits to particular indices involves changing the value of the integer itself, but changing 'self' obviously just alters the value of that local variable. Is there some way for me to change the value of the BitSequence object itself? I've also tried wrapping and delegating using __getattr__, but I couldn't figure out how to handle...
4
1825
by: marek.rocki | last post by:
First of all, please don't flame me immediately. I did browse archives and didn't see any solution to my problem. Assume I want to add a method to an object at runtime. Yes, to an object, not a class - because changing a class would have global effects and I want to alter a particular object only. The following approach fails: class kla: x = 1
7
1913
by: Andrew Robert | last post by:
Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) var = test.decode(self.qname)
24
2305
by: Peter Maas | last post by:
The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): 1. Instance variables can be easily distinguished from local variables. 2. A method from a particular class can be called as baseclass.methodname(self, <argument list>). 3. No need for declarations to disambiguate assignments to local/instance variables.
84
7231
by: braver | last post by:
Is there any trick to get rid of having to type the annoying, character-eating "self." prefix everywhere in a class? Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to use Ruby anywhere speed is not crucial especially for @ prefix is better- looking than self. But things grow -- is there any metaprogramming tricks or whatnot we can throw on the self? Cheers,
13
12031
by: Kurda Yon | last post by:
Hi, I found one example which defines the addition of two vectors as a method of a class. It looks like that: class Vector: def __add__(self, other): data = for j in range(len(self.data)): data.append(self.data + other.data)
6
1818
by: Bart Kastermans | last post by:
I am playing with some trees. In one of the procedures I wrote for this I am trying to change self to a different tree. A tree here has four members (val/type/left/right). I found that self = SS does not work; I have to write self.val = SS.val and the same for the other members (as shown below). Is there a better way to do this? In the below self is part of a parse tree, F is the parse tree of a function f with argument x. If a node...
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.