|
Dear gurus,
my app has a rich user-interface which I have to test extensively by mouse-clicking on all the menus, buttons,.....
My idea now is to create a small tool which sends all this clicks,... automatically to my application for testing the user-interface.
Does anyone have an idea how this can be accomplished?
Or are there any other ideas.
Kind regards
|
|
|
|
|
Use the System.Windows.Forms.Cursor class, this has a property Position, you can use this to move the cursor.
Regarding actually pushing the mouse button I'm not sure if you can do this without having to resort to calling the Windows API, from what I remember the mouse events are quite easy to send using the appropriate API.
This[^] article may be useful to you.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
This doesn't seem like the best way to accomplish this task. There are many, many applications out there that can be used to script mouse moves and clicks. You'll save yourself a lot of time and trouble if you use one of those.
|
|
|
|
|
While implementing an automated GUI test tool may be an interesting and fun challenge, you may be better off purchasing au automated test tool. There are quite a few on the market, and you should be able to get one for as little as $500. In the long run, it would be cheaper to purchase the tool than to invest your time into developing your own. Just my two cents...
Jim Conigliaro
jconigliaro@ieee.org
|
|
|
|
|
You can get one for significantly less than $500: free. There are shareware and freeware click generators out there that work much better than anything anyone on this board can write in a couple day's time (no offense to anyone intended).
|
|
|
|
|
Hallo !
Thanks for your answer.
Can you give me any hint which tools are free-/shareware?
With kind regard
|
|
|
|
|
Hi,
I have a VB application using a .Net(C#) dll.I made the application wait for particular time from the .net dll and during the wait if i move between other open windows,the VB application gets hanged or becomes blank screened.
I tried using System.Windows.Forms.Application.DoEvents() to repaint the Vb application but it is not that effective.
I am totally clueless
Do not wait to strike till the iron is hot; but make it hot by striking.
-- modified at 6:27 Friday 2nd June, 2006
|
|
|
|
|
What exactly are you trying to do? Are you trying to modify the VB application? If so, you may get better results in the VB group. Likewise, if you're trying to modify the C# DLL, you may get better results in the C# group.
When you say that you "made the application wait for a particular time," how did you do this? Chances are, you did this incorrectly, and this is causing your blank screen. If you block the UI thread while you're waiting, the screen won't paint.
|
|
|
|
|
Why do you ask the same question again? Keep it in one thread.
---
b { font-weight: normal; }
|
|
|
|
|
I thought i could get any solution from .net side...
I m totally stuck up with this problem...
Do not wait to strike till the iron is hot; but make it hot by striking.
|
|
|
|
|
Actually i am devloping one windows application. it is on my network drive. its running on my PC. but when i try to run my exe from different machine from the same folder , it gives me error security exception. i try to open my project on othe pc, it gives me error that project location is not fully trusted.
and when i am giving trust to my application exe from .net framework configuration tool it gives me error that hash for this assembly can not be generated.
pls. reply as soon as possible..
i am just stuck
Hemaxi
|
|
|
|
|
The runtime doesn't trust the location you're running it from, because your developing it on your machine VS has probably set all the required permissions. To run it from another PC you need to goto: Control Panel -> Administrative Tools -> Microsoft .NET [version (e.g. 2.0)] Configuration. Inside the configuration pane select "Runtime Security Policy" -> Increase Assembly Trust, a wizard will popup and guide you through the steps required to allow that program to run from the network (note this can be configured on an app by app basis or for the entire machine).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
If i use unmanaged code in my application then how does runtime comes to know that this particular piece of code is unmanaged code.
praveen
-- modified at 9:24 Thursday 1st June, 2006
|
|
|
|
|
If you're using unmanaged (unsafe) code directly in your application, you need to mark it unsafe or it won't compile. The runtime will know because you marked it. Google "unsafe code tutorial" for more help.
If you're using an unmanaged assembly (e.g. -- COM), the wrapper will deal with the unmanaged code, but you need to make sure you clean up any resources in your disposal method. Any proper tutorial on how to correctly implement the Dispose method in your classes should tell you where to put the code for disposing of unmanaged resources.
Stephan
|
|
|
|
|
I m working on Custom Controls in windows . But i m facing one problem. Let i have made one custom control and added this one to one form in a project(Let it me Kapil1). Now i have made some changes in custom control.
Now in project Kapil1 i replace the old dll of custom controls with new one. But controls which i have placed earlier r not changed. They r working according to old dll.
Can u pls tell me how can i get my old controls working according to new dll.
Kapil
|
|
|
|
|
Firstly, posting in intelligible English may help us understand what your problem is.
Secondly this problem is well known and Google should have returned something useful to you.
Thirdly, try deleting the old dll in the bin and obj directories of the project you are using the control in.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
In the VB6, we could using SaveSetting/GetSetting to store the information and get them for personalization of windows applications. But all these need the programmer to write code to save & get & set the windows layout (such as the width/height of one control of form).
Is there any application block support personalization for .net 1.1 ?
I think the dynamic property could help but I found that not all properties are supported by vs.net 2003 IDE (I haven't tried vs.net 2005), so if I wish to make the property not support by vs.net 2003 IDE, I need to write code to store the setting (maybe the runtime width changed user before the winform closed), and restore the setting saved the next time UI shown again.
If I am doing such myself, then it should be something could be an application block, but is there existing application block for personalization for winforms in .net framework 1.1 ?
--
Do or do not, there is no try.
Do or do not, there is no try.
|
|
|
|
|
Kent Liu wrote: But all these need the programmer to write code to save & get & set the windows layout (such as the width/height of one control of form).
This seems to imply that you want all settings to be saved automatically, is that what you are looking for?
Note that all settings that require saving / loading will require coding, it just depends who does it, it could be the designer (as in VS .NET one), it could be you or it could be someone else who has hidden the code behind a nice GUI.
To be honest unless you have thousands of settings it'd be easier to save them yourself. Perhaps the easiest would be to use an ArrayList to store the settings while the form is running, when the form closes this can be serialized to a file (or even :shudder: the registry if you require), and then when it runs again, deserialize it back and reload the settings from it.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi,
Is it possible to know the architecture/design of the component 'System.Web.Mail' present in .NET framework?
Ashu
|
|
|
|
|
Best starting point it'd suggest is Reflector[^] which will allow you to "see" the source code behind the class itself. I don't know of any documentation which provides a diagram of the component but it shouldn't be too difficult to use reflector.
On second thoughts I seem to remember an add-in for Reflector that would produce a relationship diagram between the classes used by the class under the cursor (in this case the Mail class), but I'm darned if I can remember exactly what it did and what it was called. Sorry
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi guys.
i have a dll (C#), if i want to place this dll in one central mechine (server). and then want to utilize this dll on different multiple mechine in dotnet application. plz code & suggestion.
|
|
|
|
|
I think what you're trying to do is link a DLL on a remote machine. You can do this compile time or run time.
If you do it compile time, everyone has to have the same mapping to the server path where the DLL is. This is easier but more prone to breaking. All you have to do is map the server drive on the development machine as you'll want it mapped on all the clients. Then add a reference to your project (assuming you're using VS.NET), browse for the DLL, and find it on the server drive.
If you do it runtime, you have to find the DLL then load it into the app domain. You'll need to deal with configuring each user machine to find the server and the right path on it to your DLL. Once you know the path to it, execute:
<br />
using System.Reflection;<br />
<br />
...<br />
<br />
Assembly myAssembly = Assembly.LoadFile(myPath);<br />
After that, you'll need to use reflection to discover what you're looking for. GetTypes() on the assembly will give you a list of classes as Type objects. Each of those will report its public methods as MethodInfo objects.
Doing this runtime is much more complicated but all procedural. If you want a bulletproof application and you're willing to take the time to code it, do that. Otherwise save the hassle and compile-time link it.
Stephan
|
|
|
|
|
Wouldn't you be able to use the app.config file to specify where the particular version of this dll is located, you can then specify that it is on the server rather than the workstation. Surely this would be easier than using reflection. If indeed it works
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Is there any way to change the original value in the DataRow?
DataRow.Item(0) may have modified/current value and its original value. I need to change its original value like row.Item("ColumnName", DataRowVersion.Original) = "NewValue". But this property is for read only any.
Ideas?
I have found the way but I don't like it and it looks like a hack.
Here's the code:
<br />
Public Function SetRowOriginalItemValue(ByVal primaryKeyColumn As DataColumn, ByVal key As Object, ByVal editColumn As DataColumn, ByVal value As Object) As Boolean<br />
'Utils.Assert.ArgumentCheckForNullReference(primaryKeyColumn, "primaryKeyColumn")<br />
'Utils.Assert.ArgumentCheckForNullReference(key, "key")<br />
'Utils.Assert.ArgumentCheckForNullReference(editColumn, "editColumn")<br />
'Utils.Assert.ArgumentCheckExpectedType(key, primaryKeyColumn.DataType)<br />
'Utils.Assert.ArgumentCheckExpectedType(value, editColumn.DataType)<br />
Dim t As DataTable = editColumn.Table<br />
Dim d As DataSet = t.DataSet<br />
Dim s As New IO.MemoryStream<br />
d.WriteXml(s, XmlWriteMode.DiffGram)<br />
s.Seek(0, IO.SeekOrigin.Begin)<br />
Dim doc As New Xml.XmlDocument<br />
doc.Load(s)<br />
Dim nsmgr As Xml.XmlNamespaceManager = New Xml.XmlNamespaceManager(doc.NameTable)<br />
nsmgr.AddNamespace("diffgr", "urn:schemas-microsoft-com:xml-diffgram-v1")<br />
nsmgr.AddNamespace("my", d.Namespace)<br />
Dim xp As String = String.Format(New Globalization.CultureInfo("en-US"), _<br />
"/diffgr:diffgram/diffgr:before/my:{0}[starts-with(@diffgr:id, '{0}')]/my:{1}[text()='{2}']/../my:{3}/node()", _<br />
t.TableName, primaryKeyColumn.ColumnName, key, editColumn.ColumnName)<br />
Dim n As Xml.XmlNode = doc.DocumentElement.SelectSingleNode(xp, nsmgr)<br />
If Not n Is Nothing Then<br />
n.Value = value<br />
d.Clear()<br />
d.ReadXml(New IO.StringReader(doc.InnerXml), XmlReadMode.DiffGram)<br />
Return True<br />
End If<br />
Return False<br />
End Function<br />
<br />
''''''''''''''''''''<br />
<br />
Sub SetRowOriginalItemValueTest()<br />
Dim d As New DistrictSet<br />
Dim row As DistrictSet.DistrictsRow<br />
row = d.Districts.NewDistrictsRow<br />
row.DistrictId = 109901<br />
row.DistrictName = "Orange County"<br />
d.Districts.AddDistrictsRow(row)<br />
d.AcceptChanges()<br />
<br />
d.Districts(0).DistrictName = "West Coast"<br />
<br />
Diagnostics.Trace.WriteLine("Current: " & d.Districts.Item(0)("DistrictName"))<br />
Diagnostics.Trace.WriteLine("Original before SetRowOriginalItemValue(): " & d.Districts.Item(0)("DistrictName", DataRowVersion.Original))<br />
<br />
SetRowOriginalItemValue(d.Districts.DistrictIdColumn, 109901, d.Districts.DistrictNameColumn, "Northeast")<br />
<br />
Diagnostics.Trace.WriteLine("Original after SetRowOriginalItemValue(): " & d.Districts.Item(0)("DistrictName", DataRowVersion.Original))<br />
End Sub<br />
Output is:
Current: West Coast
Original before SetRowOriginalItemValue(): Orange County
Original after SetRowOriginalItemValue(): Northeast
|
|
|
|
|
Apply DataTable.Rows[0].AcceptChanges()
|
|
|
|