I am trying to get user agent information for browsers in selenium, java.I tried "HttpServletRequest" and found a way as shown below. Which parameter should be specified for the "HttpServletRequest request"? is it url?
private String getUserAgent(HttpServletRequest request) {
return request.getHeader("user-agent");
}
Also, is there anyway to get a user agent in selenium, like javascript for example? Thanx.
source
share