2017-02-25 1 views

답변

0

설치 HTTPLibrary : RF 코드

from HttpLibrary import HTTP 


class JsonLib(object): 

    def load_json_data_from_file(self, filepath): 
     """ Don't forget to document the keyword!!! 
     """ 
     json_string = open(filepath).read() 
     HTTP().should_be_valid_json(json_string) 
     return json_string 

가져 오기를하고 그것을 전화 : https://github.com/peritus/robotframework-httplibrary

JsonLib.py 만들기

*** Settings *** 
Library JsonLib.py 

*** Test Cases *** 
Do Whatever With My Json 
    [Documentation] Don't forget to document what your test does!!! 
    ${my_json} Load JSON Data From File ${/}foo{/}bar.json 
+0

을 방법에 대한 파일 경로의 형식 Windows에서? – Kion

+0

아 ... 생각하지 못했습니다 ... RF 의사에 따라 수정 됨 –

+0

*** 설정 *** 라이브러리 JsonLib.py *** 테스트 케이스 *** Do My With With My Json [Documentation] 테스트의 내용을 기록하는 것을 잊지 마십시오 !!! $ {my_json} 파일에서 JSON 데이터로드 ./cookie.json – Kion

관련 문제