Executes the base state on the machine as specified by the desktop.
TestObject = BaseState.Execute()
Variable | Description |
---|---|
TestObject | The object for which the locator should wait. |
You can use the following code to specify Internet Explorer as the browser on which a web application should be tested and www.borland.com as the URL of the web application:
Dim baseState = New BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com") baseState.Execute()
To additionally store the base state in a variable:
Dim baseState = New BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com") Dim browserApplication As BrowserApplication = baseState.Execute()
To specify a mobile browser on a mobile device, for example Safari on an iOS device, you can use the following code:
Dim baseState = New BrowserBaseState(BrowserType.Safari, "www.borland.com") baseState.MobileDeviceName = "My iPhone" baseState.Execute()
You can use the following code to specify C:/windows/system32/notepad.exe as the path to the executable of the AUT and //Window[@caption='*Notepad*'] as the locator for the main window of the AUT:
Dim baseState = New BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']") baseState.Execute()
To additionally store the base state in a variable:
Dim baseState = New BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']") Dim mainWindow As Window = baseState.Execute()