简体   繁体   English

使用Selenium WebDriver在Flash Object上单击“播放”按钮

[英]Click play button on Flash Object with selenium webdriver

I have to click on play button of Flash object swf, like this 我必须单击Flash对象swf的播放按钮,像这样

在此处输入图片说明

this is its html: 这是它的html:

<object id="flashObject" width="100%" height="26px" type="application/x-shockwave-flash" name="flashObject" data="audioplayer.swf">

I am stuck here, don't know how to click on play button. 我被困在这里,不知道如何单击播放按钮。 I tried with click with id, but it didn't work, apparently. 我尝试使用ID为ID的点击,但显然没有用。 Any idea? 任何想法? Thanks 谢谢

You can use the position (x, y) of the play button in your element. 您可以在元素中使用播放按钮的位置(x,y)。 Identify the position and then use these lines of code : 确定位置,然后使用以下代码行:

Actions builder = new Actions(driver);   
builder.moveToElement(driver.findElement(By.id("flashObject")), poxXPlay, posYPlay).click().build().perform();

This should do the work. 这应该做的工作。

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

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