In Selenium 4, there is an Interface for Chrome DevTools API that lets you play with DevTools.
Here is a list of few things that we can achieve by using DevTools API with Selenium:
1. Use Console capabilities
2. Emulate network conditions
3. Perform security operations
4. Get performance and Metrics of our Browser/Network
The complete API can be found here: https://lnkd.in/f7ffwZq
Showing below how we can listen to Chrome Console logs and close the browser using the "Devtools" interface.
public static void chromeDevTools() throws InterruptedException, IOException {
try {
chromeDevTools = driver.getDevTools();
chromeDevTools.createSession();
message = "Hi everyone, this is Dheeraj.";
driver.get("https://lnkd.in/fM5JmnZ");
// execute Script to write console message
driver.executeScript("console.log('" + message + "');");
}
catch (Exception e) {
e.printStackTrace();
}
finally {
// Close browser gracefully.
chromeDevTools.send(new Command<>("Browser.close", ImmutableMap.of()));
}
selenium4 seleniumautomation automationtesting testing testAutomation
As API testing becomes more central to modern software development, the tools we use to test, automate, and debug APIs can make a big difference. For years, Postman has been the go-to API client for developers and testers alike. But now, Bruno , a relatively new open-source API client, is making waves in the community. Let’s break down how Bruno compares to Postman and why you might consider switching or using both depending on your use case. ✨ What is Bruno? Bruno is an open-source, Git-friendly API client built for developers and testers who prefer simplicity, speed, and local-first development. It stores your API collections as plain text in your repo, making it easy to version, review, and collaborate on API definitions. 🌟 What is Postman? Postman is a full-fledged API platform that offers everything from API testing, documentation, and automation to mock servers and monitoring. It comes with a polished UI, robust integration, and support for collaborati...
Great Post with valuable information. I am glad that I have visited this site. Share more updates
ReplyDeleteSelenium Online Training
Google Analytics Online course
Excellant post keep sharing and worthy information.
ReplyDeleteAngularjs Training in Chennai
Angularjs Certification Online
Angularjs Training In Bangalore
This post is so interactive and informative.keep update more information…
ReplyDeleteSoftware testing training in Anna Nagar
Software testing training in chennai