-
Notifications
You must be signed in to change notification settings - Fork 0
WebEvents.Action
This subclass contains all of the methods that interact with the browser in a default Selenium manner.
This method will trigger a hover event on the element it finds.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default:15) |
string xPath |
int retryInterval (default 1) |
Example:
WebEvents.Action.Hover(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1");
This method will search for an element in a web page until it can no longer find it, forever.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retryInterval (default 1) |
string xPath |
Example:
WebEvents.Action.WaitForeverElementVanish(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1");
This method will search for an element in a web page until it can no longer find it.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 60) |
string xPath |
int retryInterval (default 1) |
Example:
WebEvents.Action.WaitElementVanish(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1");
This method will search for either the text or the value of an element and return it.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
string xPath |
int retryInterval (default 1) |
Example:
var textValue = WebEvents.Action.GetText(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1");
This method will set the value of an element.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
string xPath |
int retryInterval (default 1) |
string text |
Example:
WebEvents.Action.SetValue(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1", "myNewValue");
This method will click on an element.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
string xPath |
int retryInterval (default 1) |
string text |
Example:
WebEvents.Action.Click(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1", "myNewValue");
This method will close a tab containing a given URL.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
string url |
int retryInterval (default 1) |
Example:
WebEvents.Action.CloseTab(chromeDriver, "https://www.google.com");
This method will close a tab containing a given URL, it also accepts an element XPath to be used as an anchor, usable in the case where there are multiple web pages with the same URL open but with different elements found in the page source.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
string url |
int retryInterval (default 1) |
string elementXPath |
Example:
WebEvents.Action.CloseTabAnchorable(chromeDriver, "https://www.google.com", "//input[text()='elementText']");
This method will wait for an alert to appear, then it will check the List of strings provided to match with the alert text, afterwards, if a match is found then the alert will be accepted, otherwise it will be dismissed.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int retries (default 15) |
List<string> acceptedAlertText |
int retryInterval (default 1) |
Example:
WebEvents.Action.WaitForAlert(chromeDriver, new List<string>() {"This is your alert text.", "This is another alert text."});
This method will highlight the element you provide for the provided duration.
Mandatory Parameters | Optional Parameters |
---|---|
ChromeDriver chromeDriver |
int duration (default 3000) |
IWebElement element |
Example:
WebEvents.Action.Highlight(chromeDriver, element);