import devtools..Network

287 views
Skip to first unread message

SiKing

unread,
Nov 10, 2021, 2:58:40 PM11/10/21
to Selenium Users
I am capturing network HTTP requests. This technique is discussed here https://applitools.com/blog/selenium-4-chrome-devtools/#h.bc0ghombcetz

When I try to import the selenium class for 'Network', I get several options:
import org.openqa.selenium.devtools.v85.network.Network;
import org.openqa.selenium.devtools.v93.network.Network;
import org.openqa.selenium.devtools.v94.network.Network;
import org.openqa.selenium.devtools.v95.network.Network;

Which one do I pick?
Are these "versions" going to change with each new release of Selenium? During Beta releases they often did.

Jim Evans

unread,
Nov 11, 2021, 8:04:56 AM11/11/21
to Selenium Users
Yes, those will change with every release. If you choose to use the raw DevTool protocol API, you’re tying yourself to a *specific* version of Chrome. This is the same reason that CDP-based automation libraries like Puppeteer tie their releases to specific versions of Chrome. Selenium provides version-agnostic APIs for common things that many people want to use CDP for, like network request/response interception and manipulation. If you find those APIs lacking, it would be instructive to know your use case, and how common it is.

SiKing

unread,
Nov 11, 2021, 12:16:57 PM11/11/21
to Selenium Users
I am pretty sure my usecase should be solved with version-agnostic APIs. Is there an example somewhere that I could look at?

My usecase is to capture traffic during OAuth2 login, and verify I get redirected through the correct servers.

TIA for the help!
Reply all
Reply to author
Forward
0 new messages