Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wbdriver Actions build.perform()

Can anybody tell me the difference between build.perform() and perform() in Selenium actions?

Example:

actions.moveToElement(menuHoverLink).perform(); 

and

actions.moveToElement(menuHoverLink).build().perform();
like image 735
Alvin George Avatar asked Mar 16 '15 06:03

Alvin George


People also ask

What does build perform () in actions?

Build(). perform() is used to compile and execute the actions class. Use the different methods under the actions class to perform various operations like click(), drag and drop and so on.

What is Perform () in Selenium?

perform() is used when multiple actions are to be chained together. java. selenium. selenium-webdriver. webdriver.

What is the use of build () in action class?

Build the actions sequence: Now, build this sequence using the build() method of Actions class and get the composite action. Build method generates a composite action containing all actions so far which are ready to be performed. Action action = actions. build();

What is action and actions in Selenium WebDriver?

Actions class is an ability provided by Selenium for handling keyboard and mouse events. In Selenium WebDriver, handling these events includes operations such as drag and drop, clicking on multiple elements with the control key, among others. These operations are performed using the advanced user interactions API.


1 Answers

A bit late to the party, but you don't have to use build() unless you want to pass an IActions object, as build() is done by perform() (see WebDriver Actions.Perform() or Actions.Build().Perform())

like image 97
towel Avatar answered Sep 20 '22 12:09

towel