-
Notifications
You must be signed in to change notification settings - Fork 0
WebEvents.ActionJs
This subclass contains all of the methods that interact with the browser in JavaScript .
They are very agile and powerful and I recommend you use them only as a last resort.
Don't use a chainsaw to cut salmon.
This method will trigger a JavaScript 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.ActionJs.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.ActionJs.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.ActionJs.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.ActionJs.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.ActionJs.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.ActionJs.Click(chromeDriver, "//*[@id='wiki-wrapper']/div[1]/h1", "myNewValue");