Coder Social home page Coder Social logo

Comments (17)

MRDcoder avatar MRDcoder commented on July 24, 2024

Also, i can't execute because no runtime environment is present. Is there any way to do it with maven plugin?

from red.

michalanglart avatar michalanglart commented on July 24, 2024

Hi,

It seems that you're seeing this error because RED is not able to locate python installation with RF installation. It is needed for various reasons. Please go to eclipse preferences and then in Robot Framework / Installed frameworks add your local directory where python is installed (or jython)

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

Hi @michalanglart
Actually i am using robotframework maven plugin which does not need to install anything extra(python,jython etc) to run robot framework in java. (http://robotframework.org/MavenPlugin/)

Please let me know how i can use RED for it now

from red.

michalanglart avatar michalanglart commented on July 24, 2024

Hello,

I didn't understood you correctly in previous comments. I gave it a thought once again, but I don't have good news.

It is currently not possible to make it work without actually having python interpreter installed (I will always refer to language itself when writing "python" and CPython when referring to its standard interpreter) and robot framework installed in it. RED needs that because it starts background server using this interpreter and communicates with this server all the time in order to for example generate libraries specifications. This interpreter can be one of following: CPython, Jython, IronPython or PyPy.

On the other hand this maven plugin downloads a single jar from maven repository which contains both the jython code and RF code, so you don't need to install anything (beside Java to run jython from this jar).

In order to make it possible RED should provide a way to point which jar file contains jython interpreter (it is located in your local maven repository) , but this is not possible at the moment.

We we'll discuss it with team and investigate issue further.

Cheers!

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024

@mhshaikh: Can I ask you simple question: What kind of IDE do You use, when you write RF tests? As far as I know RIDE do not support Maven Plugin itself and I do not see this kind of support in any other RF IDE tool.

Anyway for me introduce Maven Plugin support for RED, will be equal to answer questions:

  1. where libraries are defined and robot version - in red.xml or pom.xml? I do not like personally, if someone required for me to manage configuration in multiple files;
  2. should we override current Maven RF Plugin configuration defined in pom.xml file - since we use listener and SuiteVisitator API to support Run\Debug and Autodiscover libraries - disable this because of user configuration, will be equal to really blind tool; For SuiteVisitator as I see Maven pom parameter even not exists, so we will be need to wrote RF parameter to file and use argumentFile.

As I see main reason for introduce Maven RF Plugin, was to introduce currently exists test cases to Maven build phase, since Authors wrote: it's a non-invasive way of introducing acceptance test driven development to your existing projects quickly.

The issue with pure robotframework*.jar download by Maven is that is not start as Jython or Python interpreter, but as RobotFramework tool with options to run, verify or generate libdoc. Therefore it will be not work with RED. The only possibility to use it is to create some kind of wrapper (currently custom script is not supported) for it with specific name like jython.exe or python.exe - I made such one by using http://launch4j.sourceforge.net/ it works when I set main class as org.python.util.jython.

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

Hi @adam-wypych : I am using eclipse as a IDE for RF tests. Yes, RIDE does not support Maven plugin.

  1. I guess it should be on pom.xml because most likely if we are doing it with maven then we will modify pom.xml and won't do anything in red.xml

I really appreciate your efforts to understand my issue. I also agree that we can have some wrapper between Maven jar and RED plugin. But to be frank i don't know how to do it. I will look into link provided by you and help from your side will be appreciated:).

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024

Hi,

@mhshaikh Are You using windows or linux?

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

Windows

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024

Ok I will try to prepare simple FAQ with description how to create such wrapper.

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

Thank you so much Adam

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024
  1. Download from https://sourceforge.net/projects/launch4j/files/launch4j-3/3.8/ applicable for Your OS package - I am using launch4j-3.8-win32.zip (it is standalone version, which requires only unzip)
  2. Run launch4j.exe GUI application
  3. In Basic tab set Output file: to be jython.exe application, the location i.e. You desktop directory and switch on Dont't wrap the jar, launch only option.
    1
  4. In Classpath tab switch on Custom classpath and set Main class: to org.python.util.jython. In Edit item: please put robotframework*.jar and press Accept button. Please repeat this still and add also %RF_JAR% variable.
    2
    3
  5. In Header tab just switch Header type from GUI to Console.
    4
  6. In JRE tab please put in Min JRE version value 1.7.0.
    5
  7. After this in main menu please press Build wrapper - this option \ tools icon:
    tool
    . The application will ask you for save configuration, it is required - the name of configuration and place where it will be located is optional.
  8. If everything was done ok you will be able to see in Log text area information about Successfully created file.
    6

The created jython.exe file has to two possibilities to set robotframework*.jar location:

  1. via already set variable %RF_JAR% you can set it in System Variables
  2. using jar located in the same directory where jython.exe file is present

The last test before integration with RED - is to test if executable file was compiled ok and will work, for this I executed in command line set RF_JAR=D:\userdata\wypych\Desktop>set RF_JAR=C:\Users\wypych\.m2\repository\org\robotframework\robotframework\3.0\robotframework-3.0.jar and after jython.exe -m robot.run --version if You will see information like: Robot Framework 3.0 (Jython 2.7.0 on java1.*) it means that You can integrate jython.exe with RED.

After this You can just integrate jython.exe with RED for do this please:

  1. put jython.exe file to bin directory it could be anywhere, but it must be in bin - i.e. I put it in C:\bin\.
  2. I chose option to copy robotframework*.jar to this bin directory instead of set RF_JAR environment variable :)
  3. run eclipse.exe or RED.exe depends on which RED version You are using plugin / product
  4. go to Window -> Preferences -> Robot Framework -> Installed frameworks preference
  5. Click Add... button and select Your bin directory
  6. if everything will be ok, you should see information about Robot Framework *.* version.
  7. when you will create RED project or execute Clean\Build You should see in Robot Standard libraries standard libraries like i.e. BultIn with information about keywords, which they contains.

I hope it helps :)

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024

Hi,

Any feedback?

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

I will try and let you know

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

Thank you so much @adam-wypych
Its working. I will explore RED more and will get back to this good community in case of any issue.

from red.

adam-wypych avatar adam-wypych commented on July 24, 2024

@mhshaikh: Thanks for feedback :) If is ok for You, I will close this issue and in case of any other problem You can create new ticket.

from red.

MRDcoder avatar MRDcoder commented on July 24, 2024

yeah sure.

from red.

gpaulissen avatar gpaulissen commented on July 24, 2024

I did have some difficulties using this approach and so I created another solution. Please have a look at https://github.com/gpaulissen/jython/blob/master/BLOG.md

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.