Some Queries.... | Selenium Forum
M
Posted on 17/04/2016
[b:3lna3uwl]Query1[/b:3lna3uwl]:Why is build.perform() used while using Action class ?
What's use of build?
What's use of perform ?

[b:3lna3uwl]Query2[/b:3lna3uwl]:Can i only use build but no perform later?
If NO, why not ?

[b:3lna3uwl]Query3[/b:3lna3uwl]: Why at all use Action class ?
Answer i gave: To hover over a element , which in turn displays multiple elements[earlier notenabled/notdisplayed]

[b:3lna3uwl]Result[/b:3lna3uwl]:Answer was not satisfactory......

[b:3lna3uwl]Query4[/b:3lna3uwl]:How often you use softAssert at work? Can you elaborate more on this ?

M
Replied on 18/04/2016

query 4 https://rameshbaskar.wordpress.com/2013/09/11/soft-assertions-using-testng/

query 3 we use action class to simulate mouse movement like hovering etc.

query 1,2 The user-facing API for emulating complex user gestures. Use this class rather than using the Keyboard or Mouse directly. Implements the builder pattern: Builds a CompositeAction containing all actions specified by the method calls.
https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/interactions/Actions.html


M
Replied on 18/04/2016

Query1,2:

so if Actions A=new Actions(Driver);
Can i have,
A.moveToElement(son so)[b:1fwspmz6].build();[/b:1fwspmz6]
A.Click(so nso)[b:1fwspmz6].build();[/b:1fwspmz6]
A.Dragdrop(sonso,source,destination)[b:1fwspmz6].build().perform();[/b:1fwspmz6]

[b:1fwspmz6]Does that mean all movetoElement, click, dragdrop would be perform only in the last line of code??????????[/b:1fwspmz6]


M
Replied on 18/04/2016

no you cannot you have to build and perform.