According to the selenium documentation, interactions between the webdriver client and a browser is done via JSON Wire Protocol. Basically the client, written in python, ruby, java whatever, sends JSON messages to the web browser and the web browser responds with JSON too.
Is there a way to view/catch/log these JSON messages while running a selenium test?
For example (in Python):
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://google.com')
driver.close()
I want to see what JSON messages are going between the python selenium webdriver client and a browser when I instantiate the driver (in this case Chrome): webdriver.Chrome()
, when I'm getting a page: driver.get('http://google.com')
and when I'm closing it: driver.close()
.
FYI, in the #SFSE: Stripping Down Remote WebDriver tutorial, it is done via capturing the network traffic between the local machine where the script is running and the remote selenium server.
I'm tagging the question as Python
specific, but really would be happy with any pointers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…