简体   繁体   English

需要到达使用C#嵌入HTML的Flash电影的结尾

[英]Need to reach the end of a flash movie embedded into HTML with C#

I am attempting to use Selenium WebDriver in C# to make a single click on a page to skip to the end of a movie. 我试图在C#中使用Selenium WebDriver来单击页面以跳至电影的结尾。

<object type="application/x-shockwave-flash" 
data="flash.swf" width="100%" 
height="100%" bgcolor="#000000" id="player" name="[player" 
tabindex="0"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" 
value="always"><param name="seamlesstabbing" value="true"><param name="wmode" 
value="opaque"></object>

I am somewhat lost. 我有些失落。 I tried searching for a simple click coordinate method for Selenium WebDriver, but with no luck. 我尝试为Selenium WebDriver搜索简单的单击坐标方法,但是没有运气。 I tried to look into using JavaScript to control the flash, but unsure what script I might use. 我试图研究使用JavaScript来控制Flash,但是不确定我可以使用哪种脚本。 I am coding in C#, I am open to any potential solutions. 我正在用C#编写代码,我愿意接受任何潜在的解决方案。 My end goal is to simply skip to the end of the movie. 我的最终目标是简单地跳到电影的结尾。

Selenium can only control the browser DOM. Selenium只能控制浏览器DOM。 To control other objects, see Genie, AutoIt, Sikuli, Robot, or any number of other tools / frameworks. 要控制其他对象,请参见Genie,AutoIt,Sikuli,Robot或任何其他工具/框架。

I managed to find this. 我设法找到了。 I hope it helps for anyone who comes across this. 我希望它对遇到此问题的任何人有所帮助。

IMouse mouse = ((IHasInputDevices)driver).Mouse;
ILocatable locatableItem =   
    (ILocatable)Driver.FindElement(By.CssSelector("YOUR CSS"));
mouse.MouseMove(locatableItem.Coordinates, X, Y);

The needed libraries are: using OpenQA.Selenium; 所需的库是:使用OpenQA.Selenium;

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM