Issue
I am working with Java Selenium, testing using the Firefox driver.
I want to send Ctrl + - to my Firefox browser.
This is my code:
Common.myPrint(thisClass + " *** zoomOut ***");
Actions actionObject = new Actions(driver);
try {
actionObject.keyDown(Keys.CONTROL).sendKeys(Keys.CONTROL).keyUp(Keys.SUBTRACT).perform();
// reset this counter - basis for request counter
global.variables.dataTotalCount = 0;
return true;
} catch (Exception e) {
int errorCode = 1525182195;
System.err.println(thisClass + " error code: " + errorCode + " Exception: " + e.getMessage());
return false;
}
i am receiving this error message: Exception: Key Down / Up events only make sense for modifier keys.
That is all very well, but how can I send Ctrl & - (to reduce font size)
Solution
Try chord method
String selectkeys= Keys.chord(Keys.CONTROL, Keys.SUBTRACT);
Answered By - Prany
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.