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

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

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

Related

Drupal 7 Flags Module with Email Action Not Working?

This is a very specific problem, but I'm experiencing an issue where I have 0 knowledge and experience.
I have the Flags Module 7.x-3.7 installed on Drupal 7.44. I was able to set up an 2 actions that send emails when a user activates a flag.
Now, all of a sudden I an unable to do so. The entire system hangs indefinitely whenever I: A) Click on the “edit” link for any flags the result in an email being sent or B) Try to create a new action using “Send e-mail” as the action.
I tried removing the modules, toggling other modules… the usual fare. I’m not massively familiar with Drupal, so the intereconnected workings have me a bit nervous to mess around. I am, however, familiar with PHP and MYSQL and have access to the root, so I can investigate pretty much wherever.
So,does anyone have any idea what could be causing this issue? Why does it not move past a connecting icon and move to the new page when the links are clicked? It’s not even a WSOD as far as I can tell.Any other information you need, please feel free to ask. I’m not even sure what’s needed to troubleshoot a Drupal 7 site, honestly, but any Help would be appreciated.
Looks like the following line is causing an issue. It's in flag_actions.module, the function flag_actions_system_send_email_action_form(&$form, &$flag, $context):
$form['help']['basic'] = array(
'#markup' => theme('flag_tokens_browser', array('types' => array('flag', 'flag-action'))),
);
Commenting it out seems to solve the issue. I'd like to know WHY, and if it is safe to leave it commented out at the moment. Any ideas?

unable to locate element with Watir webdriver, Firefox, PayPal sandbox pay with PayPal

I am getting the error
Watir::Exception::UnknownObjectException: unable to locate element, using
{:id=>"submitLogin", :tag_name=>"input"}
from /Users/ktobo/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/
gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:536:in
`assert_element_found'
when running an Rspec test using Watir webdriver with Firefox.
# select "Pay with my PayPal account"
#browser.span(:class, 'buttonAsLink').when_present.click
#browser.text_field(:id, 'login_email').when_present(15).set(hsh[:email])
#browser.text_field(:id, 'login_password').when_present(15).set(hsh[:password])
#browser.input(:id, 'submitLogin').when_present.when_enabled.click
#browser.input(:id, 'continue').when_present.click
If I execute these steps one-by-one in a console, everything's great. When running the test with run.rb, the first click action seems to fail to select the "Pay with my PayPal account" span. I'm not sure why it doesn't fail on that step. If I manually click that link after the failure, I see that the password field is not populated, so something seems to be going awry before the fourth line.
Even with the when_present calls, this is most likely a race condition if it works step by step in irb, but not when run together directly. When debugging it is often useful to put a (long-ish) sleep before the problem step just to see if you are hitting a race condition. If the sleep fixes it, then you know what the problem is and just need to figure out the right thing to wait for before clicking.
Another possibility is that this could be an issue where the browser being in the "active window" in the operating system matters. (Commands should work the same way, regardless, but this isn't always the case).
Additionally, running the test with Chrome to see if you have the same issues is also helpful in troubleshooting.
If none of this works, please update your question with an url or the html you are interacting with.
On a side note, I'm surprised that nesting when_present & when_enabled works. when enabled probably should include present? as a precondition, I'll look into doing that.

MagnificPopup won´t work with Typo3

I would like to use magnific popup for a site which is still in development, but unfortunately nothing happens after the installation and adding the static content in my template.
No matter what i try no popup comes up.
If someone would like to help me i will provide access to the site.
Thanks a lot!
First thing to do:
look at your source code: does the 'link' show any sign of 'magnific popup' code?
Added classes? id?
Second: do you see any extra javascript and/or stylesheet that is added by the extension?
If you answer negative to 1 of these, the extension does not output anything. Sounds logic, but it is the first step. Is it a solution? Nope, it means your live just got a bit more worse, but hang in there !
If it does show any code from the ext: look at your console, are there any js errors occurred ? (if you don't know what console is, or (even worse) you work with IE) please read about chrome console of at least install Firefox with firebug.
My best beth would be a JS error...
Can it be possible that the ext itself does not work?
Does your php error logs tell you that the extension is behaving badly?
Do you see errors in the typoscript analyser (or whatever it's called to analyse the css_styled_content and other TS spaghetti )
If not, then no, it is not the ext.
Again, i'm betting my wive, three horses and a barrel of beer on JS erros.
Good luck mate !
ps: IF i'm wrong, i'm not sending you my wife by postal service. Loads of trouble last time. Nor the horses, same shizzle ..

Concrete5 isEditMode()-like handler to get Information about active editing or publishing

So my question is if there is a Concrete 5 handler/listener instead of
isEditMode()
that tells if the user is in active Editing mode or if he just has published his Edit?
Something like
isPublished() or isEditModeActive()
Thx yall
thanks for your interest!
So i tried the Eventhandler in the way it is decumented in the second example:
1. i created site_events.php in the /config
2. i added
<?PHP Events::extendPageType('inhalt', 'on_page_version_approve');?>
i added to the site.php
define('ENABLE_APPLICATION_EVENTS', true);
on the reffered inhalt.php pagetype i added
function on_page_version_approve() {
echo "page published";
}
... nothing happens.
In the description it is written, that the refferring inhalt.php has to exist in /controllers. However, this is not the case. I actually dont quite understand the structure of the Eventhandling. It would be great if you could help me out there...
Thanks in advance anyways :)
It sounds like you want what concrete5 calls Events (http://www.concrete5.org/documentation/developers/system/events/).
As per the docs, you'll get the Page as arguments to the functions you register.
There is nothing quite as specific as what you're looking for, but:
For published, use on_page_version_approve.
For editing, try on_before_render. It's a bit generic (ie, it'll be getting called far more than you're interested), but you can do something like if ($page->getCollectionCheckedOutUserID()). You should experiment a bit with this, though. For example, if you check out the home page for editing, and then someone else loads the live version, the event will probably get called again, and the Page will probably show "checked out". But maybe you can check ->isEditMode(), which should check it against the logged in user...

Chrome: Disable prompt for repost POST-form

Chrome has this annoying prompt for reposting POST-forms.
While the idea of preventinmg double posts is nice, it doesn't make always sense since not every POST-form posts data in a forum or buys stuff in a webshop.
But Chrome has no option to disable this annoying behaviour.
Cannot "undo":
I have a POST-form where you can beautify text (sent via POST, returns beautified text). Sometimes it makes mistakes and you want to "undo" the submission so you go back in teh browser, but no! Chrome f***s you up with its annoying repost error message.
I cannot use GET since my form text is very long so i get the "URI too long" error.
How can this be fixed?
In the past the command line switch -disable-prompt-on-repost seemed to work, but that's no solution anyway since I cannot tell all my users to do this in order to use my website.
To my joy this morning, this appears to be removed (the popup when re-posting), I'm running version 29.0.1547.57. Not sure when it was removed.
However, I'm sure you redesigned your code/site long ago.