How to find Window by variable title using TestStack.White framework?
I am using TestStack.White framework to automate opening new document in MS Word 2013. I am opening Microsoft Word application with: Application application = Application.Launch("winword.exe"); After that, I am trying to get the window by partial title: Window window = application.GetWindow("Word", InitializeOption.NoCache); But it throws an exception saying that there is no such window. Window title is: Document1 - Word The question is: How to get a window by partial title taking into consideration that the title is changing every time: "Document2 - Word", "Document3 - Word", etc. Also tried *Word but looks like this func does not support wildcards If I invoke: List windows = application.GetWindows(); after launching an application, windows list is empty. Thanks in advance, Ostap
You can use EnumWindows to find all the open windows. Within that callback you'll get a window handle which you can then us with GetWindowTextLength and GetWindowText This will let you decide what window handle is to the window you want. From there you can use GetWindowThreadProcessId to retrieve the process ID for the word document. And finally with that you can create a TestStack White application using the Application.Start()
It looks like opening window takes some noticeable time. GUI testing frameworks often have functions like Wait() to make sure the window is already created/visible/enabled. I'm not an expert in Teststack.White. Probably this document may help: http://teststackwhite.readthedocs.io/en/latest/AdvancedTopics/Waiting/
My automationelement FindFirst/FindAll seems to be very slow. How to improve the performance?
UI Automation CreatePropertyCondition 0xc0000005
NativeWindowHandle Returns 0, but Spy displays handle
Can we “click” on edit boxes using Microsoft UIAutomation libraries
Test flex mobile application built with 4.10 sdk with testcomplete
TreeWalker cant see AutomationElement, but UIA Verify can
Accessing elements of webview within a native iPhone app using UI Automation
Ranorex not able to recognise elements uniquely?
Getting / ussing full path to find controls in UIA and White
UIA: Get ControlType from control type name (string)
how to select which button to select in alert message for IOS UIAutomation
How to run multiple .trace files in one run i.e one after the other in UI automation tool?
Using TestComplete's UIAObject with Microsoft UI Automation Control Patterns
scrollToVisible error while testing on a device, UIAutomation
How to select font node in Sahi?
count the number of rows/columns using UI Automation