简体   繁体   English

我可以有一个特定于浏览器窗口的鼠标事件吗?

[英]Can I have a mouse event specific to a browser window?

I am using Selenium Webdriver for Automation, and there are few flex objects which I need to interact with. 我正在使用Selenium Webdriver for Automation,几乎没有需要与之交互的flex对象。 I know that Webdriver could not interact with flex objects.For that I have integrate the Webdriver with the ROBOT framework. 我知道Webdriver无法与flex对象交互。为此,我将Webdriver与ROBOT框架集成在一起。 The problem I am facing is that I need to have focus on the current window for the mouse to detect the location of an element. 我面临的问题是,我需要专注于当前窗口,以便鼠标检测元素的位置。 If I touch My mouse while the execution is in progress, the element could not be found. 如果在执行过程中触摸我的鼠标,则找不到该元素。

Can anyone please suggest me some alternatives to trigger a mouse event explicitly for the browser window, So that I can work on other things while my test execution is in progress? 任何人都可以建议我一些替代方法来显式触发浏览器窗口的鼠标事件,以便在测试执行过程中进行其他工作吗?

I am using Java. 我正在使用Java。

I don't believe that this is possible with Robot. 我不相信机器人可以做到这一点。 However, if you use the Actions API, then you can mouse over stuff, and so forth without having the computer actually use your mouse. 但是,如果您使用Actions API,则可以将鼠标悬停在东西上,依此类推,而无需计算机实际使用鼠标。

Actions actions = new Actions(driver);
actions.moveToElement(someElement);
actions.click();
actions.perform();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Java Selenium WebDriver的主窗口中的特定菜单中滚动鼠标 - How can I scroll mouse in specific menu in main window in Java Selenium WebDriver 两个JButton可以有相同的鼠标点击事件function吗? - Can two JButton have the same mouse clicked event function? 我想在每次点击事件中打开新窗口的浏览器……在jsp中 - i want to open new window browser at every click event… in jsp 我可以在不激活任何窗口的情况下收听键盘和鼠标事件吗? - Can I listen to keyboard and mouse events without activating any window? 仅当鼠标悬停在元素上至少一段特定时间时,如何触发MouseMove事件? - How to have a MouseMove event fire only if the mouse is hovered over an element for at least a specific amount of time? 如何禁用鼠标单击按钮动作事件? - How can I disable the mouse click on the button action event? 我可以在GXT中的鼠标单击事件中将ContentPanel添加到ContentPanel中 - Can I add a ContentPanel into a ContentPanel on a mouse click event in GXT java - 如何在按钮上获得鼠标按下事件 - How can I get mouse pressed event in java on a button 如何在 SwingGui 中调用鼠标右键单击事件? - How can I call the mouse right click event in SwingGui? 我可以使用java在后台捕获键盘和鼠标事件吗? - Can i use java to capture keyboard and mouse event in background?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM