📜  现有会话 SeleniumLibrary Instance.open_browser - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:00.783000             🧑  作者: Mango

代码示例1
def set_driver_session_id(sesion_id):
    """ Sets the sessoin_id of the current driver insance to the provided one. """
    seLib = BuiltIn().get_library_instance('SeleniumLibrary')

    if seLib.driver.session_id != sesion_id:  # this is pretty much guaranteed to be the case
        seLib.driver.close()  # this closes the session's window
        seLib.driver.quit()  # for remote connections (like ours), this deletes the session, but doesn't stop the SE

    # set to the session that's already running
    seLib.driver.session_id = sesion_id