SeleniumLibrary
SeleniumLibrary copied to clipboard
Open browser keyword fails to correctly interpret parameter service_log_path
Description: With Robot Framework > 4.x keyword Open browser (SeleniumLibrary) fails to correctly interpret parameter service_log_path and assigned value ${None}. With Robot Framework = 3.2.2 everything works fine.
Steps to reproduce the issue:
*** Variables *** ${service_log_path} ${None}
*** Keywords *** Open browser to ... ... ${browser index} Open Browser ${page_url} ${browser} remote_url=${REMOTE_URI} ... options=${browser_options} service_log_path=${service_log_path}
Expected behavior and actual behavior: By calling keyword "Open browser to" browser driver log should not be created however file with name None is created including its content (webdriver log).
Environment: robotframework = 4.1.1 robotframework-seleniumlibrary = 5.1.3 OS: Windows 10 Python 3.7.3
Answer from Tatu via google groups: In SeleniumLibrary 4 library started to relay with Robot Framework to do the argument type conversion and custom code that did handle the conversion was removed. That looks like a bug in somewhere, not totally sure where the bug is. To get things moving could you raise an issue to SeleniumLibrary issue tracker?
I can not reproduce the issue. When I do:
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${CUSTOM NONE} ${None}
*** Test Cases ***
Example
Open Browser https://github.com/robotframework/SeleniumLibrary/issues/1744 Chrome service_log_path=${CUSTOM NONE}
Close All Browsers
The None file is not created. But if service_log_path=None then None file is created, which is expected.
Are you sure that ${service_log_path} does not contain string None?
Me and my friend have copy pasted your code into our Pycharm IDE.
In both cases log file named None has been created, see output.xml file below.
<?xml version="1.0" encoding="UTF-8"?> <robot generator="Robot 4.1.1 (Python 3.7.3 on win32)" generated="20210917 10:28:24.389" rpa="false" schemaversion="2"> <suite id="s1" name="Test Easy" source="C:\Users\david\PycharmProjects\temp\issues\test_easy.robot"> <test id="s1-t1" name="Example"> <kw name="Open Browser" library="SeleniumLibrary"> <arg>https://github.com/robotframework/SeleniumLibrary/issues/1744</arg> <arg>Chrome</arg> <arg>service_log_path=${CUSTOM NONE}</arg> <doc>Opens a new browser instance to the optional ``url``.</doc> <msg timestamp="20210917 10:28:24.783" level="TRACE">Arguments: [ 'https://github.com/robotframework/SeleniumLibrary/issues/1744' | 'Chrome' | service_log_path='None' ]</msg> <msg timestamp="20210917 10:28:24.783" level="INFO">Opening browser 'Chrome' to base url 'https://github.com/robotframework/SeleniumLibrary/issues/1744'.</msg> <msg timestamp="20210917 10:28:24.783" level="INFO">Browser driver log file created to: C:\Users\david\PycharmProjects\temp\issues\None</msg> <msg timestamp="20210917 10:28:25.336" level="DEBUG">POST http://localhost:53653/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "platformName": "any", "pageLoadStrategy": "normal", "goog:chromeOptions": {"extensions": [], "args": []}}}, "desiredCapabilities": {"browserName": "chrome", "version": "", "platform": "ANY", "pageLoadStrategy": "normal", "goog:chromeOptions": {"extensions": [], "args": []}}}</msg> <msg timestamp="20210917 10:28:25.337" level="DEBUG">Starting new HTTP connection (1): localhost:53653</msg> <msg timestamp="20210917 10:28:27.738" level="DEBUG">http://localhost:53653 "POST /session HTTP/1.1" 200 791</msg> <msg timestamp="20210917 10:28:27.738" level="DEBUG">Finished Request</msg> <msg timestamp="20210917 10:28:27.739" level="DEBUG">POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/timeouts {"script": 5000}</msg> <msg timestamp="20210917 10:28:27.743" level="DEBUG">http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/timeouts HTTP/1.1" 200 14</msg> <msg timestamp="20210917 10:28:27.743" level="DEBUG">Finished Request</msg> <msg timestamp="20210917 10:28:27.744" level="DEBUG">POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/timeouts {"implicit": 0}</msg> <msg timestamp="20210917 10:28:27.747" level="DEBUG">http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/timeouts HTTP/1.1" 200 14</msg> <msg timestamp="20210917 10:28:27.747" level="DEBUG">Finished Request</msg> <msg timestamp="20210917 10:28:27.747" level="DEBUG">POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/url {"url": "https://github.com/robotframework/SeleniumLibrary/issues/1744"}</msg> <msg timestamp="20210917 10:28:28.928" level="DEBUG">http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/url HTTP/1.1" 200 14</msg> <msg timestamp="20210917 10:28:28.928" level="DEBUG">Finished Request</msg> <msg timestamp="20210917 10:28:28.928" level="DEBUG">Opened browser with session id 2540c2270de19d614881718e1550e8e6.</msg> <msg timestamp="20210917 10:28:28.928" level="TRACE">Return: 1</msg> <status status="PASS" starttime="20210917 10:28:24.783" endtime="20210917 10:28:28.928"/> </kw> <kw name="Close All Browsers" library="SeleniumLibrary"> <doc>Closes all open browsers and resets the browser cache.</doc> <msg timestamp="20210917 10:28:28.930" level="TRACE">Arguments: [ ]</msg> <msg timestamp="20210917 10:28:28.930" level="DEBUG">Closing all browsers.</msg> <msg timestamp="20210917 10:28:28.930" level="DEBUG">DELETE http://localhost:53653/session/2540c2270de19d614881718e1550e8e6 {}</msg> <msg timestamp="20210917 10:28:29.629" level="DEBUG">http://localhost:53653 "DELETE /session/2540c2270de19d614881718e1550e8e6 HTTP/1.1" 200 14</msg> <msg timestamp="20210917 10:28:29.629" level="DEBUG">Finished Request</msg> <msg timestamp="20210917 10:28:31.980" level="TRACE">Return: None</msg> <status status="PASS" starttime="20210917 10:28:28.930" endtime="20210917 10:28:31.981"/> </kw> <status status="PASS" starttime="20210917 10:28:24.782" endtime="20210917 10:28:31.982"/> </test> <status status="PASS" starttime="20210917 10:28:24.392" endtime="20210917 10:28:31.985"/> </suite> <statistics> <total> <stat pass="1" fail="0" skip="0">All Tests</stat> </total> <tag> </tag> <suite> <stat pass="1" fail="0" skip="0" id="s1" name="Test Easy">Test Easy</stat> </suite> </statistics> <errors> </errors> </robot>
... mistakenly closed the issue, re-opening again.