Hi Prerna, Yes you can handle mouse buttons using Robot class in Selenium Webdriver. Following automation script shows how you can imitate press and release of mouse buttons using Robot Class in Webdriver:
Robot robot = new Robot();
// Press Left button
robot.mousePress(InputEvent.BUTTON1_MASK);
// Release Left button
robot.mouseRelease(InputEvent.BUTTON1_MASK);
// Press Middle button
robot.mousePress(InputEvent.BUTTON2_MASK);
// Release Middle button
robot.mouseRelease(InputEvent.BUTTON2_MASK);
// Press Right button
robot.mousePress(InputEvent.BUTTON3_MASK);
// Release Right button
robot.mouseRelease(InputEvent.BUTTON3_MASK);