Collections:
Load Web Page in MicrosoftWebDriver Session
How to load Web page in a browser session with MicrosoftWebDriver server?
✍: FYIcenter.com
If you have a new session created on the MicrosoftWebDriver 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 PostSessionUrlEdge.py
# PostSessionUrlEdge.py
# Copyright (c) FYIcenter.com
import requests
data = """
{"url": "http://sqa.fyicenter.com"}
"""
id = "936A2C88-D144-49B9-B11E-F455816E7D3A"
res = requests.post("http://localhost:17556/session/"+id+"/url", data)
print("Status: " + str(res.status_code))
print("Body: " + str(res.content))
res = requests.get("http://localhost:17556/session/"+id+"/url")
print("Status: " + str(res.status_code))
print("Body: " + str(res.content))
5. Run the Python script:
C:\fyicenter> python PostSessionUrlEdge.py
Status: 200
Body: b'{"sessionId":"936A2C88-D144-49B9-B11E-F455816E7D3A",
"status":0,"value":null}'
Status: 200
Body: b'{"sessionId":"936A2C88-D144-49B9-B11E-F455816E7D3A",
"status":0,"value":"http://sqa.fyicenter.com/"}'
You should see that the Web page loaded properly in the browser.
⇒ Log Messages from MicrosoftWebDriver
⇐ Start Browser with MicrosoftWebDriver Server
2020-02-29, 2832🔥, 0💬
Popular Posts:
How to generate IPv6 Addresses? To help you to obtain some IPv6 addresses for testing purpose, FYIce...
How to generate test fractional numbers? Test fractional numbers are numbers with fractions that are...
How to validate Mod 10 (Luhn Algorithm) checksum? In order to help your programming or testing tasks...
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...
How to set Content-Type to application/json? The server requires the Content-Type to be application/...