它是如何可能点击在C#与selenium2 webdriver的具体坐标? [英] How it is possible click on specific coordinates with selenium2 webdriver in c#?

查看:714
本文介绍了它是如何可能点击在C#与selenium2 webdriver的具体坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Firefox与我的测试,但是有一个问题,当谈到点击按钮闪烁。我没有接闪元素的源代码,所以我不能使用闪光灯硒或任何测试相似。

I'm using Firefox with my test but there is a problem when it comes to clicking flash buttons. I don't have access the source codes of flash elements, so i can't use flash-selenium or anything similar for test.

目前我的解决方案越来越截图与Windows API和加工的截图,并确定哪些我应该与上的坐标Windows API的点击一下就可以了,然后再按下此键坐标。

Currently my solution is getting a screenshot with windows api, and processing the screenshot and defining the button coordinates which I'm supposed to be click on it, then again with windows api clicking on the coordinates.

不过,通过这种方式,我不能用我的电脑做别的事情,我必须等待交互不像webdriver的自身功能的PC。

But in this way, i can't use my computer for anything else and i must wait for interacting pc unlike webdriver's own functions.

我试图做的越来越截图用的webdriver(它实际上已经完成了),并获得在该截屏闪按钮的区域协调和基础,因为当我使用的检查,如果有可能硒IDE点击它没有元素Firefox的网页上,它不能像clickat功能点击还是我做错了什么。

I'm trying to do getting a screenshot on Firefox page with webdriver (it's done actually), and getting in that screenshot the area coordinates of flash button and clicking on it without element based because when i use for checking if it's possible selenium ide, it can't click with functions like clickat or i am doing something wrong.

推荐答案

在硒2,你将能够模拟鼠标移动到指定的坐标和单击高级用户交互的API使用 MoveToOffsetAction 。这是目前仍在开发之中,并在Firefox或Internet Explorer的驱动还不支持。

In Selenium 2 you will be able to simulate moving the mouse to specified co-ordinates and click using the MoveToOffsetAction in the Advanced User Interactions API. This is currently still in development and not yet supported in the Firefox or Internet Explorer drivers.

高级用户交互的API可以在项目的官方Wiki页面上找到更多细节: http://code.google.com/p/selenium/wiki/AdvancedUserInteractions

More details of the Advanced Users Interactions API can be found on the project's official wiki page: http://code.google.com/p/selenium/wiki/AdvancedUserInteractions

这篇关于它是如何可能点击在C#与selenium2 webdriver的具体坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆