Save As Dialog Issue
Posted: Thu Apr 09, 2009 8:11 pm
I am using the following code to find a Save As dialog and enter the name of the file to save in the File Name field.
I have also tried the follwoing with the same results:
The issue is that the text that is entered in the File Name field is always missing the first character (I.e. in my example above the text entered is "oo" instead of "foo"). It appears that the {Alt up} is not actually release the alt key as expected. If my text to exter has a space as the first character it opens the Save As dialog's Move menu as you would get from Alt-SPACE.
NOTE: WaitForWindow is just my own method for waiting for a window to appear and returning the Ranorex.Form object
Alt-n should verify that the cursor is in the File Name text filed since N is the hotkey.
You can verify this issue using the Notepad Save As dialog. (I.e. start Notepad and select File -> Save As)
This is using v2.0.2.
Code: Select all
Ranorex.Form HDReportSaveAsForm;
HDReportSaveAsForm = WaitForWindow("Save As", 30);
HDReportSaveAsForm.EnsureVisible();
Keyboard.Press("{Alt down}n{Alt up}");
Keyboard.Press("foo");
Code: Select all
Keyboard.Down(Keys.LMenu);
Keyboard.Press("n");
Keyboard.Up(Keys.LMenu);
NOTE: WaitForWindow is just my own method for waiting for a window to appear and returning the Ranorex.Form object
Code: Select all
Host.Local.FindChild<Ranorex.Form>(WindowName);
You can verify this issue using the Notepad Save As dialog. (I.e. start Notepad and select File -> Save As)
This is using v2.0.2.