-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Jquery event triggers not working in browser? #11403
Comments
Have you tried using the ID of the .btn instead? if that is not an option I had to append a .first() on the classes. example: $('.btn').first().trigger('click') |
Hmm, it might actually not be a click problem but something to do with the way phantom is loading things. I get a [DEBUG] Network - Resource request error: 5 ( "Operation canceled" ) URL: "http://localhost:9000/#" when I move the phantom.exit() outside the callback and into the main script scope. So it seems like it is executing the action but not sending the right response back to the server? But then again, there's a click call that is executed on load for one of the pages to select a default, but in phantom, taking a picture of the page after it has loaded, it looks like it hasn't been clicked but when it loads in Chromium the click goes through. Also, I know that it's catching events not at each specific element but just listening for propagation up the DOM when there is more than one event of that type on a page. Is there something Chromium does/passes back in the console that Phantom that does not replicate? |
UPDATE: It seems like anything inside a require block in any JS file isn't loading. Code before and after loads just fine, I can print to console before and after, but inside it doesn't work. |
Found the problem, it seems like Play framework defaults to an older version of require.js that doesn't work well with phantom. EDIT: Nope, that wasn't it. it's definitely require though, things inside require clauses aren't loading it seems. |
Problem fixed, Phantom doesn't support bind which was in one of the scripts. |
Duplicate of #10522. |
Hi, I have the following code, and I can see that the evaluate is firing because in the login.png phantom has filled in the username and password fields, however, no matter what I use to try to get the form to submit, it doesn't work. The three different ways I've tried all work in my Chromium console but it does nothing in PhantomJS. This is actually a problem that I've traced down from CasperJS since I noticed that Casper's click() wasn't firing. I assume this is a problem with PhantomJS's browser since now I'm calling the events directly and nothing is happening. This isn't just with this specific form but many other things that rely on clicks being caught by Jquery are not working Strangely, using Casper, the form submits and I am able to login but as I said, other functionality that relies on JS is not working either. Plus one of the ways I've tried to submit is just a copy of the CasperJS code.
Alternative calls I've used:
I'm using phantomJS 1.9.1 on Arch from the official repro
The text was updated successfully, but these errors were encountered: