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

Function Key

3 Answers 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 23 Jul 2012, 03:10 PM
Hi,

I am somewhat new to Test Studio, but I'm trying to setup the tool to invoke the F12 function key with the below code.  The code appears not to execute, even though I do not get a compile error.  Also just FYI, I the test is web based wtih Internet Explorer as the main browser.

desktop desk = Manager.Desktop;

desk.KeyBoard.KeyDown(System.Windows.Forms.Keys.alt);

desk.KeyBoard.KeyPress(System.Windows.Forms.Keys.F12);

3 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 23 Jul 2012, 07:48 PM
Hello Paul,

I used the following code in a Web Test and it correctly took IE into and out of Full Screen mode:

Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.F11);
System.Threading.Thread.Sleep(2000);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.F11);

What keyboard shortcut are you trying to trigger by holding down the Alt key and pressing F12?

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Paul
Top achievements
Rank 1
answered on 23 Jul 2012, 10:57 PM
Anthony,

Thank you for the reply - that did the trick.  

One more question:  Is there a way in Test Studio (TS) to detect the object of a window (i.e. like Object Spy in QTP)?  IE brings up a window that is not detected by TS, so not certain how to program or record to it.  

Thanks,
Paul 
0
Anthony
Telerik team
answered on 24 Jul 2012, 08:05 PM
Hello Paul,

You can load the DOM Explorer from the Elements Menu. Here you can inspect the DOM (HTML) or Visual Tree (Silverlight/WPF) of your application and pinpoint the element against which to record.

Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Paul
Top achievements
Rank 1
Share this question
or