Can selenium be used as a web service?

86 views
Skip to first unread message

Eden Mae Ibit

unread,
Mar 23, 2017, 4:55:15 AM3/23/17
to Selenium Users
Hi guys,

I'm really new to Selenium. I took a look at Selenium IDE and it was very easy to use but when I tried learning Selenium WebDriver but I'm having a hard time looking for good material to learn from. The way I understand this is that I has to be used with a programming language? is this correct? if not, I would prefer to use WebDriver with PHP since I'm more familiar with it. I made some research and I found that Selenium is mostly used with PHP testing frameworks but I dont want to use it with a testing framework since I'm not doing any testing. Is there anyway to use selenium with PHP only?

That being said, I would really like to know if it is possible for selenium to a web service, me and my team plan to have this as as service in the website we are hosting. 

Let's say for example, a customer request to automate a task, like to post ads on a e-commerce website using a CSV and some images. There would be some kind of form for the customer to submit their CSV file and images. And the data in the CSV would be used as materials for the ads. We make the script for this specific request, is it possible to host the script from the server and run the script from there every time the costumer want to automate the task again?

Or can the selenium only be executed from the customers computer? If so, how can the customer start the script and to open the server to get the script? What should be installed in the customers computer? A .bat file would probably one solution but I am not sure how it can access the script in the server or what files are needed to install for that matter. 


I would really appreciate the help. 

Thanks in advance! 

David

unread,
Mar 23, 2017, 4:59:05 PM3/23/17
to Selenium Users
You must be mistaken or using the wrong PHP bindings. When I last tested with PHP, most of the PHP bindings did not require PHPUnit or any framework, just the particular binding implementation of your choices (there's more than one), and PHP. For example (look through readme, wiki, example scripts):


if you want to avoid PHPUnit, etc. stay away from the PHPUnit-Selenium binding/extension, and use the other bindings instead.

As for Selenium as web service, yes you can do that, but do note that that will require running the Selenium script on the server running the web service, with the driver pointing to a WebDriver instance running somewhere (same server or remote). You can scale that better and more reliably if the web service host simply runs scripts with the actual driver instance running remotely via Selenium grid on another node or via Saucelabs, etc. And/or use PhantomJS and other headless driver instances to avoid need for GUI and slower execution.

Eden Mae Ibit

unread,
Mar 26, 2017, 11:27:04 PM3/26/17
to Selenium Users
Thank you for the response!

I'll definitely check these out.
Reply all
Reply to author
Forward
0 new messages