I am using WebdriverIO v6.5 to test a web application. I need to pull the JSON "Request Payload" of a certain object, shown here:
To accomplish this, I am using the @wdio/devtools-service
(v6.4) service and have created the following method:
However, the method does not print the JSON contents of "Request Payload". It prints other information, but not the needed JSON. Here are the results:
What should I do so that I can properly pull the "Request Payload" JSON contents? Am I in the right direction? Is there an easier way to accomplish this? I feel I am very close, but don't know how to proceed from here.
Thank you!
you can use https://webdriver.io/docs/api/browser/mock.html and get postData
from the mock like this yourMock.calls[0].postData