Selenium 点击不适用于 GWT

发布于 2024-08-20 11:59:42 字数 365 浏览 2 评论 0原文

我运行 GWT OBF (因此这个 不是问题),但是当我使用 Selenium(尝试了 IDE 和 RC)时,我的点击没有被记录。我尝试单击的组件是

,但没有任何反应。

例如,在 IDE 中,我有时(很少,比如每 50 次点击中就有一次)能够注册不同选项卡上的点击(包含在

中),但永远无法重播测试任何由此产生的点击。帮助!?!

I run GWT OBF (thus this isn't the problem), but when I use Selenium (tried both IDE and RC) my clicks don't get recorded. The component I'm trying to click is a <div>, but nothing happens.

For instance, in IDE I am sometimes (very seldom, like one in 50 clicks) able to register a click on different tabs (contained in <div>), but never able to replay the test with any resulting click. Help!?!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

長街聽風 2024-08-27 11:59:42

这是 GWT 2.0 的 Selenium 测试 的重复,但这是我的答案。

不幸的是,看看这个案例,我无法用 Selenium 复制点击。我看到很多人抱怨他们无法将 Selenium 与 GWT 一起使用,而其中一个比较著名的团队也遇到了这个问题。 Google Wave 开发团队已开始使用 WebDriver 来测试他们的代码。

现在好的事情是,目前有一个项目将 Selenium 和 WebDriver 合并,因为它们各有优缺点,而且其中许多处于不同的领域,所以最终的产品将会令人惊叹。

我相信他们可能在 Google Code 上有 WebDriverBackedSelenium 的工作版本,因此您所需要做的就是更新 Selenium 的实例化,它应该开始使用 WebDriver 代码来运行您的测试。

This is a duplicate of Selenium Testing of GWT 2.0 but here is my answer again.

Unfortunately having a look at this case I have not been able to replicate clicking with Selenium. I have seen a number of people complaining that they can't use Selenium with GWT and one of the more famous teams have that issue. The Google Wave development team have started using WebDriver to test their code.

Now the good thing is that there currently a project to merge Selenium and WebDriver as they have their strengths and weaknesses and a number of them are in different areas so the final product will be amazing.

I believe that they may have a working version of the WebDriverBackedSelenium at Google Code so all you would need to do is update the instantiation of Selenium and it should start using the WebDriver code to run your test.

红颜悴 2024-08-27 11:59:42

在这种情况下要尝试的另一件事是 selenium.fireEvent(locater, 'click')。它似乎在某些情况下工作,而 selenium.click 不起作用,具体取决于您的 dhtml 的工作方式。

Another thing to try in this situation is selenium.fireEvent(locater, 'click'). It seems to work in some situations where selenium.click doesn't, depending on how your dhtml works.

臻嫒无言 2024-08-27 11:59:42

问题是关于录音。 Selenium IDE 不会在 GWT 网站上记录。如果有工作方法可以使用 java 或任何次要的东西创建 selenium 测试。我有同样的问题,并且由于缺乏记录创建脚本所消耗的时间,所有手动编码都需要大量时间,并且弄清楚每个元素的 xpath 或 id 并不是我在记录时想要为每个步骤手动执行的操作本来可以为我们做到的。

The issue is about recording. Selenium IDE does not record on a GWT website. If there are work ways to create a selenium test using java or anything thats secondary. I have the same issue and due to lack of recording the time consumed in creating script all by hand coding takes tons of time, and figuring out the xpath or id of each element is just not what I want to do manually for each step when recording could have done it for us.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文