Selenium Insight
Please Like, View, Share, Comment to develop basics to advance knowledge base on AI ML concepts.
https://www.facebook.com/share/1DbxUYthSx/
AIMLInsight This page is intended to provide knowledge base on Artificial Intelligence (AI), Machine Learning, Agentic/Generative AI Systems and how these can be beneficial to achive the objective in today's fast track era !!!
https://www.facebook.com/profile.php?id=61562663833622&mibextid=ZbWKwL
Appium Insight This page is intended to provide knowledge on Appium tools around Mobile Automation and Testing !!!
Hi Everyone... Thank you for all your support and appreciation.
LIKES > 300++
👌👍
#8.8.1 Actions Class: Generic APIs cont...
16. moveByOffset(int xOffSet, int yOffSet)– this API is used to move the cursor from its current location (or from 0,0) by the given offset. For xOffset, -ve value means to move LEFT and for yOffset, -ve value means to move UP.
Method Signature: public Actions moveByOffset(int xOffset, int yOffset) {…}
Method Call: actions.moveByOffset(20,20).perform();
Exception thrown: MoveTargetOutOfBoundException – if the offset provided is out of the document’s boundary
17. moveToElement(WebElement webElement)– this API is used to move the cursor to the middle of the referenced WebElement from its current location.
Method Signature: public Actions moveToElement(WebElement webElement) {…}
Method Call: actions.moveToElement(webElement).perform();
18. moveToElement(WebElement webElement, int xOffSet, int yOffSet)– this API is used to move the cursor to the given offset from the top-left corner of the referenced WebElement.
Method Signature: public Action moveToWebElement(WebElement webElement, int xOffset, int yOffset) {…}
Method Call:actions.moveToElement(webElement, 10, 10) .perform();
19. pause(long milliseconds)– this API is used to make a pause to the ex*****on flow for the given amount of milliseconds (passed as a parameter to this API) irrespective of the situation and scenario. It is DEPRECATED now and so is not recommended to use.
Method Signature: public Actions pause(long milliseconds) {…}
Method Call: actions.pause(5000).perform();
20. perform()– This is used when we want to perform a single action but not multiple (for multiple-sequential action we need to make use of …build().perform();). When we call perform() API , build() API gets called internally before executing perform().
Method Signature: public Actions perform() {…}
Method Call: actions..perform();
#8.8.1 Actions Class: Generic APIs cont...
12. keyDown(Keys key)–this API is used to perform a KEY PRESS (without release) operation on any of the MODIFIER key (Keys.SHIFT, Keys.ALT or Keys.CONTROL). Once this API is called , all the subsequent interactions assume that it’s kept pressed until a call to the following API is made (either keyUp() or sendKeys(Keys.NULL))
Method Signature: public Actions keyDown(Keys theModifierKey) {…}
Method Call: actions.keyDown(Keys.CONTROL).perform();
Exception Thrown: IllegalArgumentException is thrown, if the key passed is not a MODIFIER key
13. keyDown(WebElement webElement, Keys key)–this API is used to perform a MODIFIER key press after focusing on any WebElement and is equivalent to: actions.click(webElement).sendKeys(theModifierKey);
Method Signature: public Actions keyDown(WebElement webElement, Keys theModifierKey) {…}
Method Call: actions.keyDown(webElement, Keys.CONTROL).perform();
Exception Thrown: IllegalArgumentException is thrown, if the key passed is not a MODIFIER key
14. keyUp(Key key)–this API is used to release the already pressed MODIFIER key and if tried to release any MODIFIER key which is not PRESSED state – it shows an undefined behavior.
Method Signature: public Actions keyUp(Keys thePressedModifierKey) {…}
Method Call: actions.keyUp().perform();
15. keyUp(WebElement webElement, Keys key)–this API is used to release the already PRESSED MODIFIER key after focusing on any WebElement and shows an undefined behavior when tried to release any MODIFIER key which is not in PRESSED state. This is equivalent to: actions.clcik(webElement).sendKeys(thePressedModifierKey);
Method Signature: public Actions keyUp(WebElement webElement, Keys thePressedModifierKey) {…}
Method Call: actions.keyUp(webElement, ).perform();
Coming soon... TestNG Insight FB page - A Testing tool that can help to achieve a lot more effective Test Automation framework using Selenium-Java... Stay tuned.👍
Click here to claim your Sponsored Listing.
Category
Contact the school
Telephone
Website
Address
Bangalore
562107