Selenium User Interactions - With a specific quit goal to create a succession of actions, make use of the actions generator to construct it. initially, layout it.
[java]
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL)
.click(someElement)
.click(someOtherElement)
.keyUp(Keys.CONTROL);
[/java]
Selenium User Interactions - Following are the some interactions such as.
Keyboard Interactions - As of these days, keyboard collaboration occurred through a specific element and Web Driver ensured the thing is in the suitable nation for this cooperation. This essentially comprised of looking over the thing into the view port and concentrating on the component.
Mouse interactions - Mouse activities have a
landscape
- the detail outlook of the mouse. So whilst panorama a banding collectively for some wimp sports, the primary activity might be at the same time tolerate to the objective of the detail applied as relationship, the second one pastime may be in appreciate to the vicinity of the mouse as the do of the last activity.
Generating Action chains - The action chain generator actualizes the Builder animal of propensity to fuse a CompositeAction containing a gathering of different sports. This should diminish building sports with the aid of designing an movements chains generator example and conjuring it's fabricate() way to cope with addition the complicated activity.
[java]Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(someElement)
.moveToElement(otherElement)
.release(otherElement)
.build();
dragAndDrop.perform();[/java]
Following are the keyboard interface methods.
Method |
Description |
void sendKeys(CharSequence… keysToSend) |
It is expecting a parameter of a type that implements CharSequence. |
void releaseKey(Keys keyToRelease) |
It is used to release the event action. |
void pressKey(Keys keyToPress) |
It is activated when user press any button on keyboard. |
void contextClick(WebElement onElement) |
It is the method to click on a particular event. |
void mouseMove(WebElement toElement) |
IT is utilized to move mouse depend on the input of the user. |
void mouseDown(WebElement onElement) |
It is used to drag the mouse down. |
void click(WebElement onElement) |
It is used when the same element is clicked using the click() method of the WebElement interface, then the click is triggered. |
void mouseUp(WebElement onElement) |
It is used to drag the mouse up. |
Native events versus synthetic events - In Web Driver propelled patron connections are situation to by as a choice recreating the JavaScript occasions straightforwardly or with the aid of giving the device a reveal to explicit the JavaScript events. nearby activities illustrate the purchaser cooperation better at the same time as manufactured activities are level computerized, which boot be determining in Linux when up to the individual window supervisors are utilized. Following is the desk for supporting events on exclusive browsers.
Browser |
Operating System |
Native Events |
Synthetic Events |
Firefox |
Linux |
Supported |
Supported (default) |
Firefox |
Windows |
Supported(default) |
Supported |
Internet Explorer |
Windows |
Supported(default) |
Not supported |
ItemEvent |
CheckBox,CheckboxMenuItem,Choice,List |
ItemListener |
Created when list-item or checkbox is pressed. |
Chrome |
Linux/Windows |
Supported* |
Not supported |
Opera |
Linux/Windows |
Supported(default) |
Not supported. |
HtmlUnit |
Linux/Windows |
Supported(default) |
Not supported. |