Selenium 使用Robot框架使用CORS启动chrome实例

Selenium 使用Robot框架使用CORS启动chrome实例,selenium,robotframework,Selenium,Robotframework,我是机器人框架的新手,但我想问一下,启用CORS是否可以启动Chrome实例 Run process open -n -a /Applications/Google\ Chrome.app/ --args --user-data-dir=/tmp/chrome_dev_session --disable-web-security --allow-running-insecure-content --new-window 我尝试了上述方法,但不幸的是在运行时出错 关键字'Process

我是机器人框架的新手,但我想问一下,启用CORS是否可以启动Chrome实例

Run process  open -n -a /Applications/Google\ Chrome.app/ --args  --user-data-dir=/tmp/chrome_dev_session  --disable-web-security  --allow-running-insecure-content  --new-window
我尝试了上述方法,但不幸的是在运行时出错

关键字'Process.Run Process'在命名参数之后获得了位置参数。

我也尝试过不使用两个参数之间的双间距

Run process open -n -a /Applications/Google\ Chrome.app/ --args --user-data-dir=/tmp/chrome_dev_session --disable-web-security --allow-running-insecure-content --new-window
但是,我们得到了以下错误

Keyword 'Process.Run Process' expected at least 1 non-keyword argument, got 0.
任何帮助都将不胜感激


谢谢

因为我没有测试来验证您的用例,所以我只想分享一些简短调查的结果

启动Chrome运行测试的方式不正确。在StackOverflow上,关于Chrome的一个类似问题是如何使用特定设置启动Chrome。例如,代理

使用该机制,应该可以如下设置您的特定参数:

    *** Settings ***
Library         Selenium2Library

*** Test Cases ***
Stackoverflow
    ${options}=  Evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys, selenium.webdriver
    Call Method    ${options}    add_argument      disable-web-security
    Call Method    ${options}    add_argument      allow-running-insecure-content
    Call Method    ${options}    add_argument      user-data-dir=/tmp/chrome_dev_session
    Create WebDriver  Chrome    chrome_options=${options}
    Go To    https://www.java.com/verify
    Close All Browsers
这将允许您使用执行本地测试所需的特定设置启动Chrome