Executes the base state on the machine as specified by the desktop.
TestObject = BaseState.Execute();
TestObject = BaseState.Execute()
Variable | Description |
---|---|
TestObject | The object for which the locator should wait. |
To use the base state that is stored in the configuration file config.silk4net to set the base state for a web application:
var baseState = new BrowserBaseState(); baseState.Execute();VB
Dim baseState = New BrowserBaseState() baseState.Execute()
To additionally store the base state in a variable:
var baseState = new BrowserBaseState(); var browserApplication = (BrowserApplication) baseState.Execute();VB
Dim baseState = New BrowserBaseState() Dim browserApplication As BrowserApplication = baseState.Execute()
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:
var baseState = new BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com"); baseState.Execute();
Dim baseState = New BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com") baseState.Execute()
To additionally store the base state in a variable:
var baseState = new BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com"); var browserApplication = (BrowserApplication) baseState.Execute();
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:
var baseState = new BrowserBaseState(BrowserType.Safari, "www.borland.com"); baseState.MobileDeviceName = "My iPhone"; baseState.Execute();
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:
var baseState = new BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']"); baseState.Execute();
Dim baseState = New BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']") baseState.Execute()
To additionally store the base state in a variable:
var baseState = new BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']"); var mainWindow = (Window) baseState.Execute();
Dim baseState = New BaseState("C:/windows/system32/notepad.exe", "//Window[@caption='*Notepad*']") Dim mainWindow As Window = baseState.Execute()