GithubHelp home page GithubHelp logo

Comments (16)

Mario-P avatar Mario-P commented on August 14, 2024 2

Guys, any idea when this can be implemented?

from red.

docian avatar docian commented on August 14, 2024

no... it has no effect. I'm adding the library like this:
*** Settings ***
Library PaymentMessageUtils arg0 arg1 arg2 ... arg10

from red.

michalanglart avatar michalanglart commented on August 14, 2024

We've had technical obstacle which was preventing implementation of this issue but the good news is that we're about to remove this obstacle with next version.

from red.

binithb avatar binithb commented on August 14, 2024

IMHO it'a a basic feature and will be nice to have priority. If it takes time to fix, it may be good to highlight somewhere that it is not currently supported. ( I lost close to an hour trying to fix it in red.xml and different Python versions)

from red.

michalanglart avatar michalanglart commented on August 14, 2024

We'll put that info in user guide for now. I will move the task closer to the top of backlog.

from red.

humbienri avatar humbienri commented on August 14, 2024

Isn't this more of a linter/cosmetic issue? Intellisense or lack thereof? The code still runs right?

from red.

michalanglart avatar michalanglart commented on August 14, 2024

The code still runs right?

Which code runs right? What exactly are you asking of?

RED is not able to generate library specification file for a library which requires arguments in its constructor. Without specification file it will report errors about unknown keywords; it will not show library keywords in content assistant; you will not be able to Ctrl+click on keyword to get to the source; you will not see the documentation of library and its keywords.

from red.

michalanglart avatar michalanglart commented on August 14, 2024

This issue is getting closer to the top of the backlog so hopefully we will fix it eventually

from red.

humbienri avatar humbienri commented on August 14, 2024

@michalanglart when I wrote my last comment I was seeing the "buggy/ugly" behavior as described but I was still able to execute and run my robot tests. That is what I meant by, "okay, sure...lines and KeyWords are being flagged as red but you can still run your test code".

So all the "convenient" things you can do like CTRL+Click and documentation that is useful during the development of the tests will not work. But when it comes to run time and executing the tests, they will work just fine.

As for generating the library spec file, do you mean the libdoc documentation file? Isn't the workaround to just generate that file manually from the command line?

from red.

michalanglart avatar michalanglart commented on August 14, 2024

But when it comes to run time and executing the tests, they will work just fine.

Yes of course - RED is not executing tests it just asks robot to do it so execution would work fine.

As for generating the library spec file, do you mean the libdoc documentation file? Isn't the workaround to just generate that file manually from the command line?

Yes, sure. You can generate the file manually (it has to be the xml file) using robot.libdoc module and add it to red.xml. After all this is exactly what RED is doing in the background with recognized libraries however it still does not support providing arguments when generating those files.

from red.

Mario-P avatar Mario-P commented on August 14, 2024

@michalanglart when I wrote my last comment I was seeing the "buggy/ugly" behavior as described but I was still able to execute and run my robot tests. That is what I meant by, "okay, sure...lines and KeyWords are being flagged as red but you can still run your test code".

So all the "convenient" things you can do like CTRL+Click and documentation that is useful during the development of the tests will not work. But when it comes to run time and executing the tests, they will work just fine.

As for generating the library spec file, do you mean the libdoc documentation file? Isn't the workaround to just generate that file manually from the command line?

You don't even need RED to run robot tests. RED is an IDE and things like Ctrl+C, libspec creation, documentation are the crucial part of any IDE.

from red.

humbienri avatar humbienri commented on August 14, 2024

I thought I had a clear understanding of this, but based on my struggles in the last 2 days, clearly I don't.

I thought one could get around the problem of RED not being able to cope with arguments to custom python libraries by just doing so manually via the DOS commandline and a libdoc call to generate the XML spec file.

After that, one would be able to debug/step through the python code. Wrong?

from red.

michalanglart avatar michalanglart commented on August 14, 2024

About debugging python code: you are aware that RED itself is not able to debug python code and it needs for example PyDev in order to able to do that? This is described here: http://nokia.github.io/RED/help/user_guide/launching/debug/robot_python_debug.html

As to the question: no, not wrong. I've just checked and it works (together with PyDev of course). The only thing I needed to do is to additionally extend PYTHONPATH with the path to the library (additional entry in red.xml file). Here is my example project you can check - after putting breakpoints in both robot code and argsLib.py code I was able to debug both of them:

example.zip

from red.

humbienri avatar humbienri commented on August 14, 2024

Yes, I am aware that to debug python I need and have PyDev. And in a previous effort I was able to debug both robot files and python files with the coordination/cooperation of both RED (for robot debugging) and PyDev (for python debugging).

I launch the Pydev Start Debug Server and then I launch my robot Debug configuration and it worked.

I'm just not having the same level of luck once I incorporated this locustio stuff with a constructor (which might not be needed, maybe).

The idea is that this custom python library for making api calls will be used by both the UI robot tests as well as the locust load/performance tests. That is my goal and why I having to inherit from the TaskSet class of locust.

The part about having to extend the PYTHONPATH caught my eye. In the screen shot below, is it necessary to have both? Notice I had to use the XML file for the lib documentation.

_2019Jun05102424

from red.

michalanglart avatar michalanglart commented on August 14, 2024

The part about having to extend the PYTHONPATH caught my eye. In the screen shot below, is it necessary to have both? Notice I had to use the XML file for the lib documentation.

Yes. This is visible in my example project. The thing is:

  • in order to perform by-name import of a library Robot needs to know where this library is. To do this the path to the library needs to be in your PYTHONPATH or it needs to be passed with -P argument switch when executing tests through Robot
  • when you're adding some library to red.xml by-source (pointing to some file.py) then RED will automatically add parent path of this library into -P switch once you start your tests from RED
  • if you're adding only specification file then this library is kind-of-virtual; in general there may be no source of such library at all (of course execution would not work in such case) so as a result parent path of such virtual library is not added via -P switch - it must be added differently for example in this field on the right.

Edit: try to play with my example project and have a look what is going on with arguments passed to Robot and with tests execution when you have the path added and once you remove it.

from red.

michalanglart avatar michalanglart commented on August 14, 2024

Implemented in 0.9.0. See http://nokia.github.io/RED/help/user_guide/project_config/libraries.html user guide topic for more information on that

from red.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.