question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open Browser keyword options argument does not support parsing complex structures.

See original GitHub issue

I’m attempting to launch chromedriver in a mobile view using the new mobile emulation flag. When I attempt to use it as an option for the open browser keyword, I am getting an error stating that too many args are passed.

*** Test Case ***
open browser in mobile view
     ${mobileDev}=  Create dictionary  deviceName  Galaxy S5
     open browser  www.google.com  browser=chrome 
 options=add_experimental_option("mobileEmulation", ${mobileDev})

Error returned TypeError: add_experimental_option() takes exactly 3 arguments (4 given)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
HelioGuilherme66commented, Dec 19, 2019

In use the following code and it works:

*** Keywords ***
Chrome Mobile Go To URL
    [Arguments]    ${url}    ${mobile}=Galaxy S5
    [Documentation]    Starts a Chrome Browser in Mobile Emulation with specified device model
    ${options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys
    Create webDriver    Chrome    chrome_options=${options}
    &{mobile_emulation}=    Create Dictionary    deviceName=${mobile}
    Call Method    ${options}    add_experimental_option    mobileEmulation    ${mobile_emulation}
    Create Webdriver    Chrome    chrome_options=${options}
    GoTo    ${url}
2reactions
jsellers180commented, Dec 19, 2019

@HelioGuilherme66 @aaltat thanks! I’ll implement the workaround for now but it would be cool to have the open browser keyword support the complex types.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser.Selenium — RPA Framework documentation
SeleniumLibrary is a web testing library for Robot Framework. This document explains how to use keywords provided by SeleniumLibrary.
Read more >
Robot Framework User Guide
Robot Framework is a Python-based, extensible keyword-driven automation framework for acceptance testing, acceptance test driven development (ATDD), behavior ...
Read more >
Strict mode - JavaScript - MDN Web Docs
Browsers not supporting strict mode will run strict mode code with ... Fixes mistakes that make it difficult for JavaScript engines to ...
Read more >
URL dispatcher - Django documentation
Django lets you design URLs however you want, with no framework limitations. ... The keyword arguments are made up of any named parts...
Read more >
Beautiful Soup Documentation — Beautiful Soup 4.4.0 ...
Beautiful Soup supports the HTML parser included in Python's standard library, but it also supports a number of third-party Python parsers. One is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found