1

Is there a way to identify if a HTTP request was send using Selenium?

For example if Selenium adds any request header, cookie or equivalent?

I tried looking at the User Agent, but it didn't reveal anything about Selenium:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
2
  • I don't believe there is, is there any reason why you need to do this?
    – Arran
    Jan 23, 2013 at 15:22
  • 1
    @Arran I'd like my application to behave differently when it's used by Selenium. For example when it's the System Under Test (SUT).
    – MPV
    Apr 11, 2013 at 19:15

2 Answers 2

1

I noticed that HTTP_X_FORWARDED_FOR gets set if Selenium is being used:

HTTP_X_FORWARDED_FOR => 0:0:0:0:0:0:0:1%0
1
  • Unfortunately HTTP_X_FORWARDED_FOR is used for detecting something else in our application (and the above doesn't appear to be unique to Selenium), so I won't mark this as the accepted answer yet, hoping there will be other ideas.
    – MPV
    Jan 23, 2013 at 15:04
0

Nope. Selenium doesn't mark its requests with anything.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.