You have to implement a simple stateless web service that allows one to interact with two web-browsers: Google Chrome and Mozilla Firefox.
The service should support the following endpoints:
Method
Endpoint
Parameter(s)
Description
GET /start browser, url Starts <browser> which has the <url> open inside it.
GET /stop browser Kills the <browser>.
GET /cleanup browser Deletes all the browsing session information such as history, cache, cookies, downloads, saved passwords, etc for <browser>
GET /geturl browser Returns the current active tab’s URL. Assume the <browser> has exactly one window and multiple tabs.
<browser> = chrome/firefox
<url> = Any valid URL like: [login to view URL]
Example usage of endpoints:
http://<server>/start?browser=<browser>&url=<url> should start the desired browser and open the URL in the same browser instance.
http://<server>/geturl?browser=<browser> should get the current active tab URL for the given browser
http://<server>/stop?browser=<browser> should stop the given browser if it is running
http://<server>/cleanup?browser=<browser> should clean up the browsing session for the given browser if has been stopped.
Points to note:
Browsers have to be started/stopped on the server’s end. i.e. if the server is running on machine A and a request to /start is made from machine B, the browser should start on machine A. For purpose of this assignment, assume machines A and B to be the same, i.e. your own machine.
Any tool or library that relies on the Selenium (WebDriver) protocol should not be a dependency on the service.
Service does not need to be OS independent, i.e. if you have a Windows machine, it is expected that the service runs properly in Windows but it is not expected that it runs properly across all operating systems. That said, if you provide an OS-independent implementation, you will get bonus points.
Remember to take a backup before hitting /cleanup in order to avoid erasure of your data.
Dear Client,
I propose to develop a stateless web service using Python and Flask for interacting with Google Chrome and Mozilla Firefox without relying on Selenium as a dependency. The service will support endpoints to start, stop, clean up, and retrieve URLs for both browsers. Additionally, it will ensure proper functionality within a single operating system environment.
Key Features:
Stateless web service using Python and Flask.
Start, stop, clean up, and retrieve URL endpoints for Google Chrome and Mozilla Firefox.
OS-dependent implementation with the possibility of bonus points for OS-independent design.
Data backup reminder for the /cleanup endpoint to prevent data loss.
I look forward to the opportunity to discuss this project in more detail and provide a reliable and efficient solution for browser control.