我在 Linux 下使用 Selenium 2(Web 驱动程序)和 FireFoxDriver。
我无法使用坐标右键单击 WebElement 或另一个位置。我也无法移动鼠标指针。
我尝试使用“Actions”对象:
Actions actions = new Actions(ffDriver);
WebElement we = ffDriver.findElement(By.linkText("WhatEver"))
actions.contextClick(we).build().perform();
我也尝试过使用“鼠标”对象:
Mouse mouse = ((HasInputDevices)ffDriver).getMouse();
mouse.contextClick(we.getCoordinates());
这些代码不会失败,但它们不会做任何事情。
但是,如果我在上面的两个示例中执行常规单击,它会按预期工作。
有人知道这是什么问题吗?
谢谢你。