Closed huntc closed 4 years ago
roejame...@gmail.com commented:
Does this topic help you out*? There are also other pure-JS ways to accomplish this without sacrificing asynchronousness (issue 66).
hunt...@gmail.com commented:
Hi and thanks - I'm familiar with the topic and see that the solution being proposed is one based around providing a JS one. That's ok (and I already have a js solution based on recursion), but I'm particularly interested in whether it would be useful to extend the open method to incorporate a sync/async flag; just as the xhr open method does.
Thanks again for the consideration.
ariya.hi...@gmail.com commented:
Additional note: there is a discussion about this in the mailing list.
ariya.hi...@gmail.com commented:
This should be generic, I changed the title.
Metadata Updates
erics...@blekko.com commented:
Is there any progress on this?
I would like to test interactions with web site,
Even a simple one like "Open Google. Type a search into the search bar. Click Search Button. When the search finishes, verify that a certain result is listed." i can not achieve this.
ariya.hi...@gmail.com commented:
In the mean time, you should use CasperJS: http://casperjs.org.
erics...@blekko.com commented:
Thank you for the advice, this looks awesome!
New to phantom.js, but I've done a bunch of selenium code. I did want to make sequential calls... I spiked using promises, the results are here: https://gist.github.com/fschwiet/5667135
With this approach, there is new layer of nesting only when I want to access the result of an async operation. Otherwise I can chain async operations without nesting. Errors bubble up naturally to a single error handler. Python is not required :)
It will be interesting to see how waits could be handled. From my selenium experience, I can usually limit when I need to wait to cases where I'm looking for a screen element (if an element isn't found, I'd poll the page a bit until it is).
@fschwiet Sounds like you might be a big fan of CasperJS, give it a look: http://casperjs.org/
Its API is mostly promise-based as well, so it looks relatively synchronous out-of-the-box.
maybe, I didn't want to add a dependency on python or another global install.
@fschwiet I'm pretty sure you can still use CasperJS without external dependencies, you just have to load it differently. See the "Earlier versions of CasperJS" section on the Installation page.
cc: @n1k0: Am I correct on that?
@JamesMGreene @fschwiet sure, just set the phantom.casperPath
property and inject the bootstrap script, though you'll probably miss the casperjs
command-line utility and its convenient options, especially the test
subcommand
It's not clear to me whether this is something that should be in core, but I note that a great many of the test cases in our own test suite contain race conditions because the asynchrony of the API isn't fully handled.
I'm ok that this is closed now given the use of promises. I don't think I understood how promises could solve this four years back. Thanks.
Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!
hunt...@gmail.com commented:
Disclaimer: This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #157. :star2: 13 people had starred this issue at the time of migration.