내 파이썬 파일 di.py에는 두 개의 다른 클래스가 있습니다. 가져 와서 로봇 파일에서 사용해야합니다. 이 문제를 안내해 주시겠습니까? 내 Python 파일 : di.py
import time
class di:
ROBOT_LIBRARY_SCOPE = 'TEST CASE'
def init(self):
print("*****Initialization Complete*****")
def read(self):
display = "Read Complete"
return display
print(display)
class Example:
ROBOT_LIBRARY_SCOPE = 'TEST CASE'
counter = time.gmtime()
def county(self):
print(self.counter)
return self.counter
def clear_counter(self):
self.counter = 0
print(self.counter)
로봇 파일에서 클래스의 메소드를 어떻게 사용할 수 있습니까? 내 로봇 파일은 다음과 같습니다.
*** Settings ***
Library Test.di
Library Test.Example
*** Test Cases ***
Test Read
[Documentation] Reads the DI value
[Tags] DI Read
init
${var} read
${var} clear counter
디버깅하는 동안 가져 오기 오류가 발생합니다. 제발 도와 주 시겠어요? 대단히 감사합니다.
라이브러리 가져 오기가 올바르지 않습니다. 여러 라이브러리 클래스가있는 Python 파일이있는 경우 라이브러리 가져 오기 패턴은 다음과 같아야합니다.
Library <PYTHON_FILE_NAME>.<CLASS_NAME>
가져 오기가이를 따르지 않습니다. Python 파일 이름 대신 로봇 파일 이름이있는 것 같습니다.
Library Test.di
Library Test.Example
패턴을 적용하면 올바른 가져 오기는 다음과 같아야합니다.
Library di.di
Library di.Example
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다