Skip to content

Python script promise_to always got error "No library '<Browser.browser.Browser object at 0x...>' found." #1685

@Massukio

Description

@Massukio

Describe the bug
Python script promise_to always got error "No library '<Browser.browser.Browser object at 0x...>' found."

To Reproduce
test.py

from robot.api.deco import keyword
from Browser import Browser

@keyword
def test_keyword():
    lib = Browser()
    lib.new_browser(headless=False)
    lib.new_page(url='http://www.google.com')
    promise = lib.promise_to('Wait For Response')
    body = lib.wait_for(promise)

test.robot

*** Settings ***
Library  test.py

*** Test Cases ***
Test
    Test Keyword

test.robot result

==============================================================================
Test
==============================================================================
Test                                                                  | FAIL |
No library '<Browser.browser.Browser object at 0x000001B127FC01F0>' found.    
------------------------------------------------------------------------------
Test                                                                  | FAIL |
1 test, 0 passed, 1 failed
==============================================================================

Expected behavior
Run keyword succeed and the promise_to works properly

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: chrome
  • Version: robotframework-browser==11.1.1

Additional context
Use the "Promise To" in robot file, the test can be executed and pass properly

test2.robot

*** Settings ***
Library  Browser

*** Test Cases ***
Test
    New Browser
    New Page    url=http://www.google.com
    ${promise}=  Promise To    Wait For Response
    ${body}=  Wait For  ${promise}

test2.robot result

==============================================================================
Test2
==============================================================================
Test                                                                  | PASS |
------------------------------------------------------------------------------
Test2                                                                 | PASS |
1 test, 1 passed, 0 failed
==============================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions