def sw_valid_login(self, username, password, url): """ Authenticate a valid user through the proxy to access a Social Networking Website IMPORTANT: NO NOT RUN THOSE PERFORMANCE TESTS AGAINST AN OFFICIAL SOCIAL NETWORKING WEBSITE YOUR IP MY BE BLACK LISTED. :param username: Valid Username :param password: Valid Password :param url: Valid Social Networking Website i.e: https://www.facebook.com :return: response object, with the Social Networking Website Login homepage. """ # Creates session http_adapter = HTTPAdapter(max_retries=0) self.client.mount('http://', http_adapter) self.client.mount('https://', http_adapter) # Set Certificate to authenticate in the proxy server and socialware sites self.client.cert = (CRT.CERT_CRT_PATH, CRT.CERT_KEY_PATH) # Accessing the Social Networking Website proxy_request = ProxyRequests(self.client) response = proxy_request.get_with_proxy( url ) #s.get(url, allow_redirects=False, headers=GC.HEADERS, proxies=GC.proxies) # Loggin in IDP and get the response to redirect to the Social Networking Website response = self.authenticate_in_idp(username, password) # Continue the redirect to the Social Networking Website response = proxy_request.get_with_proxy(response.headers['location']) return response
def example_through_proxy(self): proxy_request = ProxyRequests(self.client) r = proxy_request.get_with_proxy("/") return r
def sowatest_through_proxy(self, credentials): proxy_request = ProxyRequests(self.client) self.client.cookies = credentials[1] response = proxy_request.get_with_proxy("/") return response