Java 浏览器自动化-mac上的tab out
想要自动化:在mac上fire fox/current浏览器上的Tab out。从Java应用程序中使用。 Firefox19和24 不起作用Java 浏览器自动化-mac上的tab out,java,macos,selenium,Java,Macos,Selenium,想要自动化:在mac上fire fox/current浏览器上的Tab out。从Java应用程序中使用。 Firefox19和24 不起作用 someWebElement.sendKeys(Keys.TAB); 我现在所拥有的: private static java.awt.Robot robot;//in static block initialize this, at on time only one selenium is working so this is not multi
someWebElement.sendKeys(Keys.TAB);
我现在所拥有的:
private static java.awt.Robot robot;//in static block initialize this, at on time only one selenium is working so this is not multi threaded
//inside function:
try {
robot.keyPress(KeyEvent.VK_TAB);
int delay = 250;//some sleep between keys is a good idea
LangUtils.sleep(delay);
robot.keyRelease(KeyEvent.VK_TAB);
return true;
} catch (Exception e) {
logger.log(Level.ERROR, "Robot sendKeys :" + e, e);
return false;
}
你认为这有助于:
以浏览器名称/浏览器窗口标题为参数的apple脚本,将该窗口置于前端,然后向该窗口发送tab事件
还是有其他解决办法
尝试了selenium native-不支持它,但发现线程也这么说。为什么需要tab?模拟tab键按下。在早期的硒中毒中不起作用。有时候,仅仅关注另一个元素并没有帮助对不起,我只是不理解这个用例,也不理解为什么会这样needed@sircapsalot无法使用someWebElement.sendKeys(Keys.TAB);