I am facing a situation where I need Selenium webdriver to be executed on the client side.
On a webpage, I have a form with a Submit button inside it.
The action attribute of the form calls a servlet named "servletName"
.
Inside the servlet, the following code is present:
@WebServlet("/servletName")
public class chckserv extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
System.setProperty("webdriver.gecko.driver","path//geckodriver.exe");
System.out.println("In Servlet");
WebDriver driver = new FirefoxDriver();
driver.get("https://www.google.com");
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
response.getOutputStream().write("Done".getBytes("UTF-8"));
response.getOutputStream().flush();
response.getOutputStream().close();
}
}
Upon clicking the button on the HTML page, the WebDriver instance starts running on the server.
Now, my goal is to have the webdriver instance run on the client side instead.
Is there any possible way to achieve this while considering the current setup?