Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the test using resources or jpg files in an different folders ? #505

Open
lgustavolp opened this issue Sep 2, 2024 · 0 comments

Comments

@lgustavolp
Copy link

lgustavolp commented Sep 2, 2024

Describe the bug
I'm trying to use some javascript files to create a mock environment to run my tests, it is in a folder /resources in the Robot Project but when I try to run I'm getting this error below:

I got the same error if I use any file in my test, for example, a jgp file

==============================================================================
Tests

[ ERROR ] Error in file '/opt/robotframework/tests/player.robot' on line 2: Initializing library 'Browser' with arguments [ jsextension=/opt/robotframework/temp/resources/module.js ] failed: Error: Cannot find module '/opt/robotframework/temp/resources/module.js'
Require stack:

  • /usr/local/lib/python3.12/site-packages/Browser/wrapper/index.js
    Traceback (most recent call last):
    File "/usr/local/lib/python3.12/site-packages/Browser/playwright.py", line 165, in grpc_channel
    yield playwright_pb2_grpc.PlaywrightStub(self._channel)
    File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 988, in init_js_extension
    return stub.InitializeExtension(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib64/python3.12/site-packages/grpc/_channel.py", line 1181, in call
    return _end_unary_response_blocking(state, call, False, None)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib64/python3.12/site-packages/grpc/_channel.py", line 1006, in _end_unary_response_blocking
    raise _InactiveRpcError(state) # pytype: disable=not-instantiable
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.RESOURCE_EXHAUSTED
    details = "Error: Cannot find module '/opt/robotframework/temp/resources/module.js'
    Require stack:
  • /usr/local/lib/python3.12/site-packages/Browser/wrapper/index.js"
    debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-09-02T15:18:29.337848271+00:00", grpc_status:8, grpc_message:"Error: Cannot find module '/opt/robotframework/temp/resources/module.js'\nRequire stack:\n- /usr/local/lib/python3.12/site-packages/Browser/wrapper/index.js"}"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 889, in init
libraries.append(self._create_lib_component_from_jsextension(js_ext))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 975, in _create_lib_component_from_jsextension
response = self.init_js_extension(Path(jsextension))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 987, in init_js_extension
with self.playwright.grpc_channel() as stub:
File "/usr/lib64/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/usr/local/lib/python3.12/site-packages/Browser/playwright.py", line 169, in grpc_channel
raise AssertionError(error.details())
AssertionError: Error: Cannot find module '/opt/robotframework/temp/resources/module.js'
Require stack:

  • /usr/local/lib/python3.12/site-packages/Browser/wrapper/index.js

I got the same error if I use any file in my test, for example, a jgp file

Tests.Home :: Suite de testes da home page | PASS |
1 test, 1 passed, 0 failed

Tests.Signup :: Suite de testes de cadastro de dog walker

Deve poder cadastrar um novo dog walker | FAIL |
ValueError: Nonexistent input file path '/opt/robotframework/temp/toretto.jpg'

To Reproduce
Steps to reproduce the behavior:

command line1:

docker run -v ./results:/opt/robotframework/reports:Z -v C:\QAx\prj\stdRobotFram\tests:/opt/robotframework/tests:Z ppodgorsek/robot-framework:latest

command line2:

docker run -v ./results:/opt/robotframework/reports:Z -v C:\QAx\prj\stdRobotFramWD:/opt/robotframework/tests:Z ppodgorsek/robot-framework:latest

Expected behavior
A clear and concise description of what you expected to happen.

Robot template
No

Screenshots
No

Please provide any relevant information, such as:

  • OS: WIn 11
  • Browser chrome

Additional context
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant