but I can’t seem to get the webdriver to inherit the desired capabilities of Katalon.
You are right. In the code you create a new instance of ChromeDriver and let Katalon to use it. Katalon does not modify any desired capabilities of your instance.
In this alternative, you use the WebDriver instance created by Katalon Studio. You check if it is an instance of ChromeDriver; if so you call Selenium Logging API and get log information from the Chrome; the print the obtained messages.
In this alternative, you use the WebDriver instance created by Katalon Studio. You check if it is an instance of ChromeDriver; if so you call Selenium Logging API and get log information from the Chrome; the print the obtained messages.
Great, thanks that works!!! Do you know the appropriate desired capabilities for getting info logs? I’ve tried adding --log-level=INFO, --verbose and --enable-logging but no luck.
The above one line is using Selenium Logging API. See https://github.com/SeleniumHQ/selenium/wiki/Logging. The Selenim Logging API was a part of the Selenium WebDriver API. The Selenium WebDriver API was defined by the Selenium project sometime around 2009.
Nowadays, the Selenium WebDriver API has become a sort of heritage; it is destined to be superseded by the W3C WebDrvier specification (https://www.w3.org/TR/webdriver/). All of browsers are supposed to support the W3C WebDriver as de facto.
We should be aware that the W3C WebDriver API does NOT include any Logging API. The W3C WebDriver team is not going to put high priority to Selenium Logging API-equivalent feature. You can read a comment by a member of the W3C WebDriver spec team in the following post:
Well, we need to come to agreement with the other browser vendors about a sensible API. I don’t think the polling nature of the Selenium API is particularly sensible, but it may be the only option given the restrictions of having an HTTP protocol.
The tracking issue on the WebDriver standard is w3c/webdriver#406, but as we are just finishing up “level 1” for Candidate Recommendation, it is unlikely to be worked on in the near future.
Sorry if I misunderstand you but do mean that the getting the browser logs may soon no longer be possible?
I do know that my current chromedriver does have logging capabilities since in the if I input chromedriver -help into the command prompt I get the following.
the getting the browser logs may soon no longer be possible?
Sorry for making you confused.
What I wrote about Chrome is groundless. Please forget it.
What I wrote about Firefox is, I think, solid. Please note it.
I’m aware of the issue with firefox but since I’m using chrome might it be possible to get the info logs? I just can’t seem to get the desired capabilities correct.
Would be able to tell me if you used --verbose, --log-level=ALL, --enable-logging or anything like that? I gave them as arguments but have since been unsuccessful. Any guidance you could give would be appreciated.
if you used --verbose, --log-level=ALL, --enable-logging
I do not quite understand what you mean.
Do you mean giving these options for chromedriver.exe? Specifying --log-level=ALL to chromedriver.exe would let chromedirver.exe to log all it is designed to — which does not include asking Chrome browser to transfer its internal console.log(“…”) texts to you and merge the texts into the chromedriver.log file.
And this appears to work for other people but I have been unable to get the same results.
I assume this is a problem with the desired capabilities.
I have tried a combination of desired capabilities including the ones mentioned. In particular, I thought adding both --verbose and --enable-logging should have yielded the INFO browser logs.
No error messages. It opens the url in the browser as expected but in the katalon console no browser logs are printed. As I understand it, WebUI.openBrowser(null) is a correct alternative to WebUI.openBrowser(’ ') but I did try rewriting it. No change.
This project worked for me. I could get JavaScript Console Log from Chrome browser like this:
>>> [2018-07-25T09:44:47+0900] [SEVERE] http://demoaut.katalon.com/favicon.ico - Failed to load
>>> [2018-07-25T09:44:48+0900] [WARNING] http://demoaut.katalon.com/profile.php#login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.gl/zmWq3m.