Issue
I was reading over the Selenium docs and i couldn't quite work out whether you could run it on a server - as part of a larger web app.
ie. something happens in the web app that triggers the automated Selenium script to run, then returns result to web app.
Is that a possible use of Selenium or does it always need an actual browser to run the tasks inside of, or can it run a virtual browser for itself ?
Solution
Selenium always need an instance of a browser to control.
Luckily, there are browsers out there that aren't that heavy as the usual browsers you know. You don't have to open IE / Firefox / Chrome / Opera. You can use HtmlUnitDriver
which controls HTMLUnit - a headless Java browser that does not have any UI. Or a PhantomJsDriver
which drives PhantomJS
- another headless browser running on WebKit.
Those headless browsers are much less memory-heavy, usually are faster (since they don't have to render anything), they don't require a graphical interface to be available for the computer they run at and are therefore easily usable server-side.
Answered By - Petr Janeček
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.