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

SendKeys.

2 Answers 267 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SD
Top achievements
Rank 1
SD asked on 18 Aug 2010, 06:02 AM
Hi, 

I've been trying to use System.Windows.Forms using .NET 3.5 SP1 VSE 08' and Webaii Nunit setup and found out I don't have aval.
Is this an assembly I need to add to the IDE ? 
I want to be able to use the SendKeys class for  SendKeys.Send("{ENTER}"); Any idea guys ? Ta.

2 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 18 Aug 2010, 10:42 AM
Hello SD,

Did you get this working?

System.Windows.Forms is not an assembly added by default in a WebAii test project. You need to add a reference manually from the project references. You can find that one in the list of standard .Net assemblies.

Regards,
Konstantin Petkov
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
0
SD
Top achievements
Rank 1
answered on 19 Aug 2010, 12:37 AM
Yep, that's pretty easy. Added a ref to system.windows.forms and it looks like it's better to use
the SendWait method as follows: 
SendKeys.SendWait("{TAB}");
The following link is pretty helpful (Make sure you chose the dotnet version you currently using): 
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.sendwait(v=VS.90).aspx

Using the above I was able to approach a file upload menu, and then initiated a sequence of key strokes that 
loaded a file via the web interface. Since the majority of 'Load File' web interfaces work in the same way, it's easy to exc.

From here it's a short way to write a sequencer methods that takes a string of key strokes and initiates it. 

Ta, 
Seth. 
Tags
General Discussions
Asked by
SD
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
SD
Top achievements
Rank 1
Share this question
or