webdriver下 如何模拟右键菜单操作?action.contextClick(element)命令可实现鼠标右键点击操作,例如:
Actions action = new Actions(driver) ;
action.contextClick(driver.findElement(By.xpath("//div/li/div/a/span"))).perform();
PS: .perform()要记得。
-------------纪念20120713劳动成果
webdriver下 如何模拟右键菜单操作?action.contextClick(element)命令可实现鼠标右键点击操作,例如:
Actions action = new Actions(driver) ;
action.contextClick(driver.findElement(By.xpath("//div/li/div/a/span"))).perform();
PS: .perform()要记得。
-------------纪念20120713劳动成果