对GWT应用程序进行Selenium测试 - 请求未发送至服务器 [英] Selenium test on a GWT app - request not sent to server

查看:89
本文介绍了对GWT应用程序进行Selenium测试 - 请求未发送至服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为GWT应用程序编写一个硒测试。它使用鼠标悬停/
mousedown / mouseup方法来点击按钮。它点击我的应用程序的Login
按钮,该按钮调用含有userid和
密码输入字段的div,并且工作得很好。然后输入用户名和
密码,然后点击登录表单的提交按钮。



如果我慢慢运行它,我可以看到按钮点击,但请求永远不会
被发送到服务器(我正在观看线路)。

实际上,如果在selenium IDE仍处于打开状态时,我手动点击
按钮,请求不会被发送。如果我然后关闭硒IDE
并点击按钮,请求就会通过罚款。



有人看过这个吗?这似乎很奇怪。

更新:

Firebug显示脚本错误。显然,硒脚本与GWT脚本有一些冲突。这是错误的开始,但整件事情相当长:

[Exception ...''com.google.gwt.core.client.JavaScriptException:( TypeError):result is null fileName:chrome://selenium-ide/content/recorder.js lineNumber:74 stack:([object XMLHttpRequest],POST, http:// localhost:8080 / login ,true)@chrome://selenium-ide/content/recorder.js:74 XPC_SJOW_CallWrapper((function(url,windowName ,windowFeatures,replaceFlag){if(self.openCalled){return self.originalOpen.call(window,url,windowName,windowFeatures,replaceFlag);} else {self.o

解决方案

好的,我找到了答案,这有点令人尴尬,但它提供了答案,也很有趣,我会分享答案,以便避免问题,并且或许会对我的开销大加嘲笑:)

答案是你必须编译成OBF而不是PRETTY。所有的屁股下面列出了相关的链接。他们完全解释了这个问题,以及如何避免它。



这有什么好笑的?那么,在我进行搜索时,我终于碰到了下面的第一个链接。几乎立即,我意识到,或者至少有一个偷偷摸摸的怀疑,我以前解决了这个问题。果然,原来的问题是在十月份发布的,我是海报。所以,我之前得到了答案,完全忘了。呃,好吧。希望答案可以帮助某人,而我的漫画不幸也会为你的一天增光。

http://clearspace.openqa.org/message/50170



http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread / 5d6a9c448a82b916 / af62e5877237b107?lnk = raot



http://code.google.com/p/google-web-toolkit/issues/detail?id=2861


I'm writing a selenium test for a GWT app. It uses the mouseover/ mousedown/mouseup approach to click pushbuttons. It clicks the Login button of my app, which calls up the div containing userid and password entry fields, and that works just fine. It then enters a userid and password, then clicks the Submit button for the login form.

If I run it slowly, I can see the button click, but the request never gets sent to the server (I'm watching the wire).

In fact, if, while the selenium IDE is still open, I manually click the button, the request is not sent. If I then close the selenium IDE and click the button, the request goes through fine.

Anybody seen this one? It seems really strange.

Update:

Firebug shows a script error. Apparently, the selenium script has some conflict with the GWT script. Here's the beginning of the error, but the whole thing is quite lengthy:

[Exception... "'com.google.gwt.core.client.JavaScriptException: (TypeError): result is null fileName: chrome://selenium-ide/content/recorder.js lineNumber: 74 stack: ([object XMLHttpRequest],"POST","http://localhost:8080/login",true)@chrome://selenium-ide/content/recorder.js:74 XPC_SJOW_CallWrapper((function (url, windowName, windowFeatures, replaceFlag) {if (self.openCalled) {return self.originalOpen.call(window, url, windowName, windowFeatures, replaceFlag);} else {self.o

解决方案

Okay, I found the answer. It's a little embarrassing, but it provides the answer and it's funny, too. I'll share the answer so that you can avoid the problem, and perhaps have a laugh at my expense. :)

The answer is that you have to compile to OBF instead of PRETTY. All the associated links are listed below. They fully explain the problem, and how to avoid it.

What's funny about this? Well, as I was going through search, I finally hit upon the first link below. Almost immediately, I realized, or at least had a sneaking suspicion, that I had solved this problem before. Sure enough, the original question was posted in October, and I was the poster. So, I got an answer before, and completely forgot. Ah, well. Hope the answer helps someone, and my comic misfortune brightens your day.

http://clearspace.openqa.org/message/50170

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/5d6a9c448a82b916/af62e5877237b107?lnk=raot

http://code.google.com/p/google-web-toolkit/issues/detail?id=2861

这篇关于对GWT应用程序进行Selenium测试 - 请求未发送至服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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