Reputation: 743
I am new to the White. Can someone tell me how to run an exe file (with a log password) and print all the elements from that exe file?
I did use
Application application = Application.Launch("exe /password)"
but it is not working.
Upvotes: 1
Views: 1494
Reputation: 195
#region lanch App
// source exe file path. here it is calculator exe path
const string ExeSourceFile = @"C:\Windows\system32\calc.exe";
//Global Variable to for Application launch
White.Core.Application _application;
//Global variable to get the Main window of calculator from application.
White.Core.UIItems.WindowItems.Window _mainWindow;
//start process for the above exe file location
var psi = new ProcessStartInfo(ExeSourceFile);
// launch the process through white application
_application = White.Core.Application.AttachOrLaunch(psi);
//Get the window of calculator from white application
_mainWindow = _application.GetWindow
(SearchCriteria.ByText("Calculator"), InitializeOption.NoCache);
#endregion
Upvotes: 0
Reputation: 11
Elisa I am assuming you want to get the phone numbers from a form which contains a listview or gridview and write them to a file or some other control. So of the top of my head:) here it goes
//Launch the app
Application app = Application.Launch("full path of .exe");
//Get the main window after launching the app
Window win = app.GetWindow(Core.UIItems.Finders.SearchCriteria.ByAutomationId("Form1"), Core.Factory.InitializeOption.NoCache);
//get the list/gridview its of type table in white
var listOfPhonesNumbers= win.Get<Table
>(SearchCriteria.ByAutomationId("grdPhoneNumber"));
for(int i =0; i "<" listOfPhoneNumbers.Rows.Count; i++) { ///print phone number to whatever file }
Upvotes: 1