通过获取Selenium2Library的实例来获取driver
from robot.libraries.BuiltIn import BuiltIn def get_webdriver_instance(): seleniumlib = BuiltIn().get_library_instance('Selenium2Library') return seleniumlib.driver