1

I have a complex javascript-intensive application I wish for which I wish to use python and selenium for automated testing. However, at the same time I need to have access to the http headers for both the request and response so I can do some security analysis as well.

Is there a way to integrate the use of selenium with the requests module so I have the best of both worlds?

Bharat Mane
6,78512 gold badges42 silver badges69 bronze badges
asked May 2, 2018 at 3:52
2
  • This might be helpful for you stackoverflow.com/questions/5799228/… Commented May 2, 2018 at 4:52
  • It's possible with Selenium. Either use a proxy server to intercept the requests or launch the browser with a custom webextension to capture the requests/responses. Commented May 2, 2018 at 14:47

1 Answer 1

2

Selenium is an e2e testing solution which works well with what is happening in browsers. It automates anything working in browser- mimicking what the users would try to do.

Instead of combining the API tests in Selenium and checking for the headers, you should have a different set up for API Testing, using Python requests module or Chakram in JS.

It's a bad idea to combine two different types of tests in same.

answered May 2, 2018 at 14:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.