1 problem:My application is, when i click a button i got a open dialog box.
Now my problem is how to automate to select particular file and click open button .
2 problem:
My Application has second button which open a console window and ask the user to enter something.
My problem is to automate this console window and write whatever i write in program.
plz help.Tell function names which can be used in c++ of visual studio.
Problem in open dialog box in c++
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Please use the following C++ sample code:1. Now my problem is how to automate to select particular file and click open button .
(I tried this with the sample VS2005Application.exe)
Code: Select all
int ret = RxMenuSelectItemText(form, "Submenu3", "FileOpen", NULL);
RxSleep(1000);
HWND fileOpenDialog = RxFormFindTitle("Open", MATCH_EXACT, TRUE, 1500);
// Get the Element of the TextBox
ElementStruct element;
if ( RxControlGetElement(fileOpenDialog, &element) == TRUE)
{
ElementStruct textbox;
BOOL bRet = RxElementFindChild(&element, ROLE_SYSTEM_TEXT, "File name:", NULL, &textbox);
if (bRet==TRUE)
{
//RxElementSelect(&listItem, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
RxElementSetValue(&textbox, "myFile");
ElementStruct openButton;
bRet = RxElementFindChild(&element, ROLE_SYSTEM_PUSHBUTTON, "Open", "Button", &openButton);
if (bRet==TRUE)
{
::RxMouseClickElement(&openButton);
}
}
}
Use the function RxControlSendKeys to write data into a console window.2. My problem is to automate this console window and write whatever i write in program.
Jenö
Ranorex Team