简体   繁体   中英

Flash automation with c#

I want to do test automation on a flash web page. All i have in source is some Object tag and that's all. I can't navigate anywhere using xpath or class selector .

So for that I have that code:

ChromeOptions options = new ChromeOptions();
IWebDriver driver = new ChromeDriver(options);
driver.Manage().Window.Maximize();

driver.Url = url;

var body = driver.FindElement(By.XPath(".//body"));

Actions action = new Actions(driver);
action.MoveToElement(body, MouseXCoordinate, MouseYCoordinate).Click().Build().Perform();

I can't find any better solution. Can't I use anything better than this? It's a bit uncomfortable to do everything using coordinates.

You won't be able select any elements within Flash object using Selenium Webdriver. Similar case if you have JavaScript canvas and you need to click on something inside Canvas. All you can do is point a mouse cursor on certain coordinates, and perform click.

If you want to query objects inside Flash, learn about Ranorex. It is not cheap library though.

Another alternative to automating flash since selenium is unable is a framework/library called http://www.sikuli.org/ (i realize it isn't c# but its free...at least last time i checked).

It has been a few years since i've used sikuli but at a high level, it uses pictures/images of your UI in order to perform matches against it. So you take a bunch of screenshots, use their scripting language (i believe it is python actualy) and create automation scripts in this manner.

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