Collections:
Load Web Page in ChromeDriver WebDriver Session
How to load Web page in a browser session with ChromeDriver WebDriver server?
✍: FYIcenter.com
If you have a new session created on the ChromeDriver WebDriver server,
you can follow this tutorial to load a Web page in the session
using the "POST /session/{id}/url" service:
1. Enter the following Python script to load a Web page in an existing session. Remember to copy the session ID from the output of the previous tutorial.
C:\fyicenter> type PostSessionUrlChrome.py
# PostSessionUrlChrome.py
# Copyright (c) FYIcenter.com
import requests
data = """
{"url": "http://sqa.fyicenter.com"}
"""
id = "d1e9fd4561397db9b4deb2cb5bbd0dbf"
res = requests.post("http://localhost:9515/session/"+id+"/url", data)
print("Status: " + str(res.status_code))
print("Body: " + str(res.content))
res = requests.get("http://localhost:9515/session/"+id+"/url")
print("Status: " + str(res.status_code))
print("Body: " + str(res.content))
5. Run the Python script:
C:\fyicenter> python PostSessionUrlChrome.py
Status: 200
Body: b'{"value":null}'
Status: 200
Body: b'{"value":"http://sqa.fyicenter.com/"}'
You should see that the Web page loaded properly in the browser.
⇒ Log Messages from ChromeDriver WebDriver
⇐ Start Browser with ChromeDriver WebDriver
2019-12-02, 2527🔥, 0💬
Popular Posts:
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
Where to find tutorials on Apache JMeter test tool? I want to know how to use Apache JMeter. Here is...
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...
How to see my IP address Host Name? To help you to see your IP Address Host Name, FYIcenter.com has ...
How to validate email address format? In order to help your programming or testing tasks, FYIcenter....