저는 Python과 Robotframework 스크립트를 혼합하여 사용하여 프로젝트를 구현했습니다.구성 구문 분석 Robotframework
class MyConfigManager(ConfigManager):
"""
Class to hold all config values in form of variables.
"""
def __init__(self):
super().__init__("dispatch/config.ini")
self._android = Android(self._config)
@property
def username(self):
return self._config.get(_env_section, "Username")
@property
def password(self):
return self._config.get(_env_section, "Password")
config = MyConfigManager()
:
[Environment]
Username: [email protected]
Password: testpassword
[WebUI]
login_url: http://testsite.net/
파이썬이 같은 CONFIGMANAGER 객체를 사용하여 확실히 위의 변수를 해석 할 수있다 : I는 다음과 같습니다의 config.ini 파일 내 프로젝트 내부에 저장된 구성 항목의 무리가 있습니다
Robotframework에서 config.ini를 변수 파일로 가져 와서이 값을 사용할 수 있습니까? Robot 스크립트에 다른 변수 파일을 갖고 싶지 않습니다.
편집 :
내 로봇 파일과 같은 뭔가를 시도하고있다 :
*** Settings ***
Documentation WebUI Login Tests
Library SeleniumLibrary
Resource common_keywords.robot
Variables config.ini
#^will this work?
Default Tags Smoke
Suite Setup Set Selenium Timeout 15seconds
Suite Teardown Close Browser
*** Variables ***
${login_button} class:auth0-lock-submit
*** Test Cases ***
TC001_Login_Test
[Documentation] Open login page, login with credentials in arguments.
Open Browser Confirm Login Page chrome ${login_url}
Provide Input Text name:email ${username}
Provide Input Text name:password ${password}
Find Element And Click ${login_button}
# the three vars ${login_url}, ${username}, ${password} would be from
# config.ini but this isnt working. What am I doing wrong? or is not
# possible to do this?