1

I am working on a project with selenuim and phantomjs. I need to know after filling a form and clicking on the submit button if the data was sent to the server or if the data wasn't used. I tried to check the har file that I got after the submit button that was pressed, but this turned out to be a bad solution. Any other ways?

Thanks.

Sivan
  • 11
  • 1

1 Answers1

0

I don't know what language you are using, but maybe these will help:

using proxy and selenium

Example of BrowserMob Proxy and Selenium

from browsermobproxy import Server

    server = Server("path/to/browsermob-proxy")
    server.start()
    proxy = server.create_proxy()

    from selenium import webdriver
    profile  = webdriver.FirefoxProfile()
    profile.set_proxy(proxy.selenium_proxy())
    driver = webdriver.Firefox(firefox_profile=profile)

    proxy.new_har("google")
    driver.get("http://www.google.co.uk")
    proxy.har # returns a HAR JSON blob

    proxy.stop()
    driver.quit()

post request and selenium

In this case you will have to:

  1. Send post using Java
  2. Add cookies
  3. Send everything to web driver