Browser Methods

Authenticate

Authenticates to the server authentication request which is handled by windows or the browser, and not the webpage itself. If no AuthenticationDialog was found on the screen, the method assumes no authentication was required and does nothing. For Internet Explorer the authentication dialog is sometimes opened behind the browser window and therefore not visible. For this reason, if the BrowserType is IE, the method minimizes the browser window to find the dialog, if it was not detected at first, afterwards the browser window is again brought to the front with Alt-Tab.

Syntax:

public void Authenticate(
	string username,
	string password
)

Parameters:

Parameter

Description

username

Type: String The username that shall be used for the authentication.

password

Type: String The password that shall be used for the authentication.

CheckDownloadSuccessful

Checks if the download was successful and cleans up the notifications and dialogs from the download.

Syntax:

public bool CheckDownloadSuccessful(
	int timeout
)

Parameters:

Parameter

Description

timeout

Type: Int32 The timeout in seconds after which the download should be completed.

Return Value:

true if the download was successful, false otherwise.

DownloadAndSaveFileAs Method

Downloads and saves a file under the given path. Browser needs to be configured that it asks what to do with the file to download. This method assumes there is already a download request initiated.

Syntax:

public bool DownloadAndSaveFileAs(
	string path,
	int timeout = 60
)

Parameters:

Parameter

Description

path

Type: String The path where the file should be saved to.

[timeout]

Type: Int32 The timeout in seconds after which the download should be completed.

Return Value:

true if the download was successful, false otherwise.

GetURL

Copies the URL from the URL textbox and returns it as a string. Special handling for edge to trim \r at the end and close the suggestions.

Syntax:

public string GetURL()

Return Value:

The URL of the current page as a string.

GoBack

Goes back one page using the browser back button. Caller needs to wait for and verify the expected page.

Syntax:

public void GoBack(
    ImgDiffTolerance tolerance = ImgDiffTolerance.Large
)

Parameters:

Parameter

Description

[tolerance]

Type: ImgDiffTolerance Tolerance value for the update check when verifying the click on the back button. If previous page differs only slightly from the current page, this value should be changed to a lower tolerance. Default: Large

GoForward

Goes forward one page using the browser forward button. Caller needs to wait for and verify the expected page.

Syntax:

public void GoForward(
    ImgDiffTolerance tolerance = ImgDiffTolerance.Large
)

Parameters:

Parameter

Description

[tolerance]

Type: ImgDiffTolerance Tolerance value for the update check when verifying the click on the forward button. If next page differs only slightly from the current page, this value should be changed to a lower tolerance. Default: Large

GoToURL

Navigates the browser to an URL. URL should end in "/" to avoid problems with verification.

Syntax:

public void GoToURL(
	string url,
	bool waitUntilStableScreen = true
)

Parameters:

Parameter

Description

url

Type: String The url including the "/" at the end.

[waitUntilStableScreen]

Type: Boolean if true (default) we wait for a stable screen after navigating to the url.

Last updated