Selenium test on a GWT app - request not sent to server

你。 提交于 2019-12-22 11:04:34

问题


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

|improve this question

回答1:


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




回答2:


Maybe you could try clickAt or mouseDownAt, they seem to perform a bit differently.



来源:https://stackoverflow.com/questions/514263/selenium-test-on-a-gwt-app-request-not-sent-to-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!