This is a migrated thread and some comments may be shown as answers.

[Solved] WebAii Support for Testing Desktop Applications

1 Answer 80 Views
Telerik Testing Framework
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason Divis
Top achievements
Rank 1
Jason Divis asked on 19 Mar 2010, 01:53 PM
I see there is some support with interacting with the Desktop via the WebAii framework. And I have verified a bit of that framework by creating a simple form with a textbox and button. I can launch the form from my Nunit test (Process.Start), and can even utilize the Desktop.KeyBoard.KeyDown method to input some text into the form. The trouble comes when I try to Click the mouse.

Dim Desktop As New Desktop 
Desktop.Mouse.Click(MouseClickType.LeftClick, 200, 200) 
MsgBox("Done"




results in:

System.NullReferenceException : Object reference not set to an instance of an object.

I also tried moving the mouse

Desktop.Mouse.Move(0, 0, 200, 200) 

, and receive:

System.NullReferenceException : The Settings.Current object has not been set. It is Null.

I see that there is a way to define a Webaii settings configuration section, but I'm beginning to question the framework's ability to interact with a winform when the settings all have to do with browsers and URLs...

Is there some reason the Mouse object needs these settings to interact with a webform when the Keyboard did not?

Thanks in advance for your help.

-J.




1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 19 Mar 2010, 07:50 PM
Hello Jason,

Thanks for the post. Unfortunately, the WebAii framework does not support WinForms applications as it does browser based web applications using page controls (Html, Ajax, Rad, Silverlight). So you would not have the full automation and verification features for your WinForms app as a Web App.

But as you mentioned on your last post, it does simulate Desktop actions that you could use. I was able to reproduce the the error you are getting. In order to get around this error, you would have to instantiate a Manager object and and launch a browser like this:

Dim m As New Manager(New Settings)
m.Start()
m.LaunchNewBrowser()
m.Desktop.Mouse.Move(0, 0, 200, 200)
MsgBox("Done")
m.Dispose()

Since the launched browser now has focus, you can then get a handle on your app's window using WebAii's Window class to reset focus:

Dim w As ArtOfTest.Common.Win32.Window = New ArtOfTest.Common.Win32.Window(Process.Handle)
w.SetActive()
w.SetFocus()

You can then use the properties of the Window class to help with what you are trying to do.

All the best,
Nelson Sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Telerik Testing Framework
Asked by
Jason Divis
Top achievements
Rank 1
Answers by
Missing User
Share this question
or