首页 > 解决方案 > 最大化浏览器窗口,RobotFramework

问题描述

我正在学习 RobotFramework,我有一个简单的脚本:

*** Settings ***
Documentation  Simple Amazon.in demo
Library  SeleniumLibrary

*** Variables ***
${MESSAGE}  Hello, World

*** Test Cases ***
User must sign in to check out
    [Documentation]  This is some basic info about the test
    [Tags]  Smoke
    Open Browser  http://www.amazon.in  firefox
    Input text  id=twotabsearchtextbox  Ferrari 458
    Click Button  xpath=//div[@class='nav-search-submit nav-sprite']/input[@class='nav-input' and 1]
    Wait until page Contains  results for "Ferrari 458"
    Click Link  css=#result_0 a.s-access-detail-page
    Wait until Page Contains  Back to search results for "Ferrari 458"
    Click Button  id=add-to-cart-button
    Wait Until Page Contains  1 item added to Cart

一切正常,但浏览器窗口没有最大化,请帮助我,我该怎么做。

这是我的点子配置

robotframework                 3.1
robotframework-requests        0.5.0
robotframework-seleniumlibrary 3.2.0
selenium                       3.141.0

标签: pythonrobotframework

解决方案


首先,您可以Maximize Browser Window在打开浏览器后使用关键字。

如果这不起作用;这里建议有可能的修复: https ://github.com/robotframework/SeleniumLibrary/issues/123

看看能不能解决你的问题。让我知道是否有。


推荐阅读