robotframework / SeleniumLibrary

Web testing library for Robot Framework
Apache License 2.0
1.38k stars 758 forks source link

Open browser keyword fails to correctly interpret parameter service_log_path #1744

Open davidk1 opened 2 years ago

davidk1 commented 2 years ago

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?

aaltat commented 2 years ago

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?

davidk1 commented 2 years ago

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"?>

https://github.com/robotframework/SeleniumLibrary/issues/1744 Chrome service_log_path=${CUSTOM NONE} Opens a new browser instance to the optional ``url``. Arguments: [ 'https://github.com/robotframework/SeleniumLibrary/issues/1744' | 'Chrome' | service_log_path='None' ] Opening browser 'Chrome' to base url 'https://github.com/robotframework/SeleniumLibrary/issues/1744'. Browser driver log file created to: C:\Users\david\PycharmProjects\temp\issues\None 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": []}}} Starting new HTTP connection (1): localhost:53653 http://localhost:53653 "POST /session HTTP/1.1" 200 791 Finished Request POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/timeouts {"script": 5000} http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/timeouts HTTP/1.1" 200 14 Finished Request POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/timeouts {"implicit": 0} http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/timeouts HTTP/1.1" 200 14 Finished Request POST http://localhost:53653/session/2540c2270de19d614881718e1550e8e6/url {"url": "https://github.com/robotframework/SeleniumLibrary/issues/1744"} http://localhost:53653 "POST /session/2540c2270de19d614881718e1550e8e6/url HTTP/1.1" 200 14 Finished Request Opened browser with session id 2540c2270de19d614881718e1550e8e6. Return: 1 Closes all open browsers and resets the browser cache. Arguments: [ ] Closing all browsers. DELETE http://localhost:53653/session/2540c2270de19d614881718e1550e8e6 {} http://localhost:53653 "DELETE /session/2540c2270de19d614881718e1550e8e6 HTTP/1.1" 200 14 Finished Request Return: None All Tests Test Easy

`

davidk1 commented 2 years ago

... mistakenly closed the issue, re-opening again.