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

uploadRobotFile returns Action Error : java.lang.NullPointerException #26

Open
j0hnsa opened this issue Jul 2, 2024 · 8 comments
Open
Assignees
Labels

Comments

@j0hnsa
Copy link

j0hnsa commented Jul 2, 2024

Hello, while trying to use the uploadRobotFile action a java.lang.NullPointerException occurs.
image

the action is configured like this:
image

Can you please advise?

@vertigo17
Copy link
Member

Can you confirm that the robot extention runs on a windows system ?
You configured a Windows path and logs looks like docker based so I guess running under Linux.
If using a standard docker image path should be more like /home/seluser/Downloads/test.json
That way the file will be created on the robot side directly inside Download folder. Ready to be uploaded from the browser to your application.

@j0hnsa
Copy link
Author

j0hnsa commented Jul 2, 2024

It does run on windows system, is this action limited to linux hosts?

@vertigo17 vertigo17 self-assigned this Jul 3, 2024
@vertigo17 vertigo17 added the bug label Jul 3, 2024
@vertigo17
Copy link
Member

There are no reason that this shouls not work on windows.
I will have a look why npe was raized

@j0hnsa
Copy link
Author

j0hnsa commented Jul 15, 2024

I've tested with linux and the error seems to be present too, maybe I'm missing something
VirtualBox_centos9_15_07_2024_22_50_32
VirtualBox_centos9_15_07_2024_22_51_03

@vertigo17
Copy link
Member

Thanks for the log. I will try to reproduce that.

@vertigo17
Copy link
Member

A couple of question that may help to identify the issue:
Did you secure that folder C:\CerberusData\ or whatever folder you specified on your test under a linux docker image existed ?
Can you test putting /home/seluser./downloads/test.json after making sure that folder /home/seluser/Downloads/ exist ?
Also secure that parameter -a (--authorisedFolderScope) has been feed with /home/seluser/Downloads/ or docker compose include it this way:

  selenium-node-chrome:
    image: cerberus-node-chrome
    environment:
      HUB_HOST: selenium-hub
      SE_OPTS: -servlets org.cerberus.robot.extension.sikuli.ExecuteSikuliAction -servlets org.cerberus.robot.extension.filemanagement.ExecuteFilemanagementAction -servlets org.cerberus.robot.extension.management.ExecuteManagementAction
      JAVA_OPTS: -DauthorisedFolderScope=/home/seluser/Downloads
    depends_on:
      - selenium-hub
    expose:
      - "5900"
    ports:
      - "XXXXXX:5900"
    volumes:
      - /etc/localtime:/etc/localtime:ro
    restart: always
    shm_size: 512mb
    deploy:
      resources:
        limits:
          cpus: '0.8'
          memory: 1548M

@vertigo17
Copy link
Member

From your logs, I see that -a (--authorisedFolderScope) has been feed with null.
For sure that will have a strange behaviour.
Let me know when you can test with that parameter defined.

@j0hnsa
Copy link
Author

j0hnsa commented Aug 1, 2024

I'm not being able to launch a node with the argument -a, an exception is raised, can you please advise on how to use it?

Below is one example of the command I tried to use with the -a:

java -cp "selenium-server-standalone-3.141.59.jar;cerberus-robot-extension-1.8-SNAPSHOT-full.jar" org.openqa.grid.selenium.GridLauncherV3 -role node -hub http://127.0.0.1:4444/grid/register -port 4445 -a "C:\selenium" -servlets org.sikuliserver.ExecuteSikuliAction -servlets org.cerberus.robot.extension.sikuli.ExecuteSikuliAction -servlets org.cerberus.robot.extension.filemanagement.ExecuteFilemanagementAction -servlets org.cerberus.robot.extension.management.ExecuteManagementAction
Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter '-a' but no main parameter was defined in your arg class
at com.beust.jcommander.JCommander.initMainParameterValue(JCommander.java:936)
at com.beust.jcommander.JCommander.parseValues(JCommander.java:752)
at com.beust.jcommander.JCommander.parse(JCommander.java:340)
at com.beust.jcommander.JCommander.parse(JCommander.java:319)
at org.openqa.grid.selenium.GridLauncherV3.parse(GridLauncherV3.java:218)
at org.openqa.grid.selenium.GridLauncherV3.lambda$buildLaunchers$7(GridLauncherV3.java:271)
at org.openqa.grid.selenium.GridLauncherV3.lambda$launch$0(GridLauncherV3.java:86)
at java.base/java.util.Optional.map(Optional.java:265)
at org.openqa.grid.selenium.GridLauncherV3.launch(GridLauncherV3.java:86)
at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:70)

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

No branches or pull requests

2 participants