简体   繁体   中英

Click play button on Flash Object with selenium webdriver

I have to click on play button of Flash object swf, like this

在此处输入图片说明

this is its 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. Any idea? Thanks

You can use the position (x, y) of the play button in your element. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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