I want to show custom message on the chrome infobar instead of "Chrome is being controlled by an automated test software". How is this possible using selenium?
Unfortunately, there does not seem to be any way of having custom infobars in Chrome. However, there is usually more than one way to skin a cat. If you need a mechanism to give test meta-info to the tester (iteration #, variable values, test title, etc) that works for all browsers, then you can just change the title of the page, like this:
String javascript = "document.getElementsByTagName('title')[0].textContent = 'yourtext';";
((JavascriptExecutor) Common.driver).executeScript(javascript);
Note that while you're still in Java, you can modify "yourtext" any way you want. Just make sure that you're not checking the title of the web page as part of your selenium test.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With