Question

I am writing a simple install script with TestStack White so i can learn the framework (I didn't find a lot of info online).

I'm using league of legend install for this little experiment

after I fill the forms, and pressing the next buttons, there is a window that opens from the install program.

I want to know if there is a way to GET the window even if i wasn't the one who executing it.

this is the code i'm using to run the application, up to the moment the new window opens:

private void pressXButton(White.Core.UIItems.WindowItems.Window currentWindow, string buttonName)
    {
        var xButton = currentWindow.Get<White.Core.UIItems.Button>(White.Core.UIItems.Finders.SearchCriteria.ByText(buttonName));
        xButton.Click();
        currentWindow.WaitWhileBusy();
    }

    public void RunScript()
    {
        White.Core.Application application = White.Core.Application.Launch(filePath);
        White.Core.UIItems.WindowItems.Window window = application.GetWindow(windowTitle);
        window.WaitWhileBusy();

        pressXButton(window, NEXT_BUTTON_TEXT);

        var radioButtonAgree = window.Get<White.Core.UIItems.RadioButton>(White.Core.UIItems.Finders.SearchCriteria.ByText("I accept the terms in the License Agreement"));
        radioButtonAgree.Select();
        window.WaitWhileBusy();

        pressXButton(window, NEXT_BUTTON_TEXT);
        pressXButton(window, NEXT_BUTTON_TEXT);
        pressXButton(window, NEXT_BUTTON_TEXT);
        pressXButton(window, NEXT_BUTTON_TEXT);
        pressXButton(window, NEXT_BUTTON_TEXT);
        pressXButton(window, "Install");

//afther pressing the Install Button the program ask to install  Microsoft Visual C++ 2005 Redistributable Package and here is where im stcuk




    }

(sorry for my english)

No correct solution

OTHER TIPS

You can use Desktop.Instance.Windows() to get at all the windows, not just the ones in the process you are testing.

Otherwise you have to use Application.Attach("processname") to get the process of the Microsoft Visual C++ 2005 Redistributable Package

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top