Interface ITestingDriver
The Interface for the Testing Driver software.
Namespace: TestingDriver
Assembly: TestingDriver.dll
Syntax
public interface ITestingDriver
Properties
| Improve this Doc View SourceCurrentURL
Gets the url of the page the webdriver is focued on.
Declaration
string CurrentURL { get; }
Property Value
Type | Description |
---|---|
System.String |
ErrorContainer
Gets or sets the error container to check if any errors are shown on the UI.
Declaration
string ErrorContainer { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LoadingSpinner
Gets or sets the loadiong spinner that appears on the website.
Declaration
string LoadingSpinner { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LocalTimeout
Gets or sets the local timeout to attempt to find and wait for elements.
Declaration
int LocalTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Name
Gets the name of the testing driver.
Declaration
ITestingDriver.TestingDriverType Name { get; }
Property Value
Type | Description |
---|---|
ITestingDriver.TestingDriverType |
Methods
| Improve this Doc View SourceAcceptAlert()
Accepts the alert provided that there is an alert.
Declaration
void AcceptAlert()
Back()
Goes back a page.
Declaration
void Back()
Check(String, Boolean, String)
Performs the actions of clicking a check box. Uses Selenium binding by default.
Declaration
void Check(string xPath, bool byJS = false, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to find the specified element. |
System.Boolean | byJS | Whether to use JS to perform the click / not. |
System.String | jsCommand | Any js command needed. |
CheckErrorContainer()
Checks if there are any errors in the error container.
Declaration
void CheckErrorContainer()
CheckForElementState(String, ITestingDriver.ElementState, String)
Checks for an element state.
Declaration
bool CheckForElementState(string xPath, ITestingDriver.ElementState state, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to find the web element. |
ITestingDriver.ElementState | state | The state of the web element to wait for. |
System.String | jsCommand | Any JS command to use when finding the element. |
Returns
Type | Description |
---|---|
System.Boolean | If the element state is as wanted. |
ClickElement(String, Boolean, String)
Performs the actions of clicking the specified element. Uses Selenium binding by default.
Declaration
void ClickElement(string xPath, bool byJS = false, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to find the specified element. |
System.Boolean | byJS | Whether to use JS to perform the click / not. |
System.String | jsCommand | Any js command needed. |
CloseBrowser(Boolean)
Closes the current window. It will quit the browser if it is the last window opened.
Declaration
void CloseBrowser(bool all = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | all | Whether to close all tabs in the browser. |
DismissAlert()
Dismisses the alert provided taht there is an alert.
Declaration
void DismissAlert()
ExecuteJS(String)
Executes JS command.
Declaration
void ExecuteJS(string jsCommand)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsCommand | command. |
ForceKillWebDriver()
Force kill web driver.
Declaration
void ForceKillWebDriver()
Forward()
Goes Fowards a page.
Declaration
void Forward()
GenerateAODAResults(String)
Generates the AODA results.
Declaration
void GenerateAODAResults(string folderLocation)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderLocation | The folder to generate AODA results in. |
GetAlertText()
Gets the text inside the alert.
Declaration
string GetAlertText()
Returns
Type | Description |
---|---|
System.String | Alert Text. |
GetAllLinksURL()
The GetAllLinksURL.
Declaration
List<string> GetAllLinksURL()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | The List{string}. |
GetElementAttribute(String, String, String)
Returns the given attribute for the element given.
Declaration
string GetElementAttribute(string attributeName, string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | The name of the attribute. |
System.String | xPath | xpath to find the attribute. |
System.String | jsCommand | any js command to use. |
Returns
Type | Description |
---|---|
System.String | the value of the attribute. |
GetElementText(String, String)
Returns the given text for the element given.
Declaration
string GetElementText(string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | xpath to find the attribute. |
System.String | jsCommand | any js command to use. |
Returns
Type | Description |
---|---|
System.String | the value of the attribute. |
LaunchNewTab(String, Boolean)
Tells the browser to launch a new tab.
Declaration
bool LaunchNewTab(string url = "", bool instantiateNewDriver = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL for the browser to navigate to. |
System.Boolean | instantiateNewDriver | Instantiates a new selenium driver. |
Returns
Type | Description |
---|---|
System.Boolean | if the navigation was successful.
|
Maximize()
Maximizes the browser.
Declaration
void Maximize()
NavigateToURL(String, Boolean)
Tells the browser to navigate to the provided url.
Declaration
bool NavigateToURL(string url = "", bool instantiateNewDriver = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL for the browser to navigate to. |
System.Boolean | instantiateNewDriver | Instantiates a new selenium driver. |
Returns
Type | Description |
---|---|
System.Boolean | if the navigation was successful.
|
PopulateElement(String, String, String)
Performs the action of populating a value.
Declaration
void PopulateElement(string xPath, string value, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to use to identify the element. |
System.String | value | The value to populate. |
System.String | jsCommand | Any js command needed. |
Quit()
Quits the webdriver. Call this when you want the driver to be closed.
Declaration
void Quit()
RefreshWebPage()
Refreshes the webpage.
Declaration
void RefreshWebPage()
RunAODA(String)
Method to run aoda on the current web page.
Declaration
void RunAODA(string providedPageTitle)
Parameters
Type | Name | Description |
---|---|---|
System.String | providedPageTitle | Title of the web page the user provides. |
SelectValueInElement(String, String, String)
Performs the action of selecting a value in an element.
Declaration
void SelectValueInElement(string xPath, string value, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to use to identify the element. |
System.String | value | The value to select in the element. |
System.String | jsCommand | Any js command needed. |
SendKeys(String)
The SendKeys.
Declaration
void SendKeys(string keystroke)
Parameters
Type | Name | Description |
---|---|---|
System.String | keystroke | The keystrokeSystem.String. |
SetTimeOutThreshold(String)
Sets the global timeout in seconds.
Declaration
void SetTimeOutThreshold(string seconds)
Parameters
Type | Name | Description |
---|---|---|
System.String | seconds | maximum duration of timeout. |
SwitchToIFrame(String, String)
Switches to appropriate IFrame. Use root in xpath to leave the iframe.
Declaration
void SwitchToIFrame(string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | xPath to find the iFrame. use "root" to leave iframe. |
System.String | jsCommand | Any js command needed. |
SwitchToTab(Int32)
The SwitchToTab.
Declaration
void SwitchToTab(int tab)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tab | The tabSystem.Int32. |
TakeEntireScreenshot(String, Boolean)
Takes a screenshot of the browser. Screenshot will have the datestamp as its name. Year Month Date Hour Minutes Seconds (AM/PM).
Declaration
bool TakeEntireScreenshot(string fileName, bool isMobile)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The fileName of the testing driver. |
System.Boolean | isMobile | Whether it is a mobile device. |
Returns
Type | Description |
---|---|
System.Boolean | if screenshot was successfully taken.
|
TakeScreenShot(String)
Takes a screenshot of the browser. Screenshot will have the datestamp as its name. Year Month Date Hour Minutes Seconds (AM/PM).
Declaration
void TakeScreenShot(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The fileName of the testing driver. |
Uncheck(String, Boolean, String)
Performs the actions of unchecking the specified element. Uses Selenium binding by default.
Declaration
void Uncheck(string xPath, bool byJS = false, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to find the specified element. |
System.Boolean | byJS | Whether to use JS to perform the click / not. |
System.String | jsCommand | Any js command needed. |
VerifyAttribute(String, String, String, String)
Returns whether or not the actual attribute value of the check box matches with the expected value, given a verification attribute string to check.
Declaration
bool VerifyAttribute(string attribute, string expectedValue, string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | attribute | Verification attribute string to check. |
System.String | expectedValue | Expected value to compare with. |
System.String | xPath | The xpath of the element. |
System.String | jsCommand | Any js command needed. |
Returns
Type | Description |
---|---|
System.Boolean | if actual attribute value matches with the expected value.
|
VerifyDropDownContent(List<String>, String, String)
Returns whether or not the drop down list contains all the given strings.
Declaration
bool VerifyDropDownContent(List<string> expected, string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | expected | The list of expected strings. |
System.String | xPath | The xpath of the element. |
System.String | jsCommand | Any js command needed. |
Returns
Type | Description |
---|---|
System.Boolean | the drop down contains all the given strings.
|
VerifyElementSelected(String, String)
Returns whether or not the element is selected or not.
Declaration
bool VerifyElementSelected(string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath of the element. |
System.String | jsCommand | Any js command needed. |
Returns
Type | Description |
---|---|
System.Boolean | the element is current selected.
|
VerifyElementText(String, String, String)
Returns whether or not the element's text is the same as the expected value.
Declaration
bool VerifyElementText(string expected, string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | expected | What the value is expected to be. |
System.String | xPath | The xpath of the element. |
System.String | jsCommand | Any js command needed. |
Returns
Type | Description |
---|---|
System.Boolean | if it is the same.
|
VerifyFieldValue(String, String, String)
Returns whether or not the element's value attribute is the same as the expected value. Usually for form-like elements.
Declaration
bool VerifyFieldValue(string expected, string xPath, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | expected | What the value is expected to be. |
System.String | xPath | The xpath of the element. |
System.String | jsCommand | Any js command needed. |
Returns
Type | Description |
---|---|
System.Boolean | if it is the same.
|
Wait(Int32)
Sets implicit wait timeout in seconds.
Declaration
void Wait(int seconds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | seconds | Maximum timeout duration in seconds. |
WaitForElementState(String, ITestingDriver.ElementState, String)
Waits for an element state.
Declaration
void WaitForElementState(string xPath, ITestingDriver.ElementState state, string jsCommand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | xPath | The xpath to find the web element. |
ITestingDriver.ElementState | state | The state of the web element to wait for. |
System.String | jsCommand | Any js command needed. |
WaitForLoadingSpinner()
Waits until the loading spinner disappears.
Declaration
void WaitForLoadingSpinner()