What is Action Class?ĭid I mention Action Class, actually it is not a class but an Interface. But then what is Action class and how does it different with Actions Class. Because maybe you have noticed the top blue line in the above screenshot, the build method returns Action class. The below screenshot shows the list of methods available.Īlso, an important thing to bring here is that there is one another class which is called Action Class and it is different from Actions class. There is a huge collection of methods available in Actions class. Collection of such Action is represented by the Actions class. Individual action mentioned above are represented by a class called Action, we will talk about it later. Moving the mouse pointer to the element. In this case we are looking at two different Action we may want to perform a mouse click on an element. Actions ClassĪctions class is a collection of individual Action that you want to perform. The class description clearly states that we can perform complex user interaction using the Actions class. Implements the builder pattern: Builds a CompositeAction containing all actions specified by the method calls. Use this class rather than using the Keyboard or Mouse directly. The user-facing API for emulating complex user gestures. You can see this by hovering over Actions class in any IDE, a pop up menu should open up as shown below. Let us start by taking a look at the information shown by intellisense for the Actions class. In this tutorial, we are going to cover Actions class and its usage. To handle those types of advance actions we have the Actions class in Selenium. However, there are complex interactions like Drag-n-Drop and Double-click which cannot be done by simple WebElement commands. Even interactions with drop-down are enabled using the Select class which exposes commands like selectByValue(), deselectAll() to select and deselect options. Submitting a form can be done using the WebElement.submit() command. Commands like WebElement.click() and ndKeys() are used to click on buttons and enter text in text boxes. Most user interactions like clicking on a button, entering text in textbox can be done using the WebDriver Element Commands. In this tutorial we will learn about the Actions class in Selenium.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |