Import Keywords section in robot script - robotframework

I am working with robot framework and want to know if it is possible to save my Keywords that I build in section Keyword and import them in other robot scripts?
I hope you understand my question and can give me some helps.
Best
Pouyan

That is the purpose of a Resource file. You can move that Keywords section to a file with extension .robot or .resource, and then in the test suite file at Settings section use the Resource your_resource.resource import.
A resource file cannot have test cases.

Related

How to put debug/Breakpoint in Robot framework test in Pycharm?

My .py files in Robot-Framework allows me to introduce breakpoints but .robot file it doesn't allow. How do i introduce and toggle breakpoints in my .robot test files for debugging?
Nohow - you can't add a Pycharm breakpoint in a .robot file.
The reason is your test script is not a real python code. When a run is started, Pycharm runs the entry point of the robot module - which reads the file's text, parses it in its internal structures and "converts" to python code (in quotes, as it really doesn't convert anything, makes RF objects and constructs a flow b/n them).
The actual python code that is ran is in the robotframework package (and any other py packages & modules it imports). For both the framework and Pycharm the .robot file is just a text file - thus no breakpoints are effective.
You can add a breakpoint inside a py file - one of the framework's, or in a library of yours, and it will be honored.
Or, you can use the Debug library - once it hits the point where you've put the Debug keyword, it gives you an interactive shell with full context at the current point (e.g. you can CRUD variables, or run available keywords).
It is possible to add breakpoints to both .py and .robot files with Robot Framework Language Server.
There are plugins for both PyCharm and VS Code.

Is there a way to change the imports on multiple Robot Framework files without manually opening each one?

Basically one of the main import files changed directory so instead of the import file being ../../FileName it is now ../../../Filename. Is there a way to do this without opening each file and typing "../" every time.
Depending on your OS, IDE or other tool, just Replace All. Really easy with VSCode.
From CLI, you can try: https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files
Make a file system link - at the old location "../../FileName" pointing to the new one "../../../FileName".
Use notepad ++ find and replace in files feature.

What is the use of yaml files in zephyr

I have started understanding zephyr
Looking into samples/basic/blinky, there is a file sample.yaml
From Documentation:
Bindings are files in YAML format.
.dts files describe the available hardware devices, but don’t tell the
system which pieces of information are useful, or what kind of
configuration output (#define’s) should be generated. Bindings provide
Just to understand the importance, i moved the sample.yaml into our home folder and built, flashed the led blink application and it blinks.
Is it necessary to have yaml file in our application directory and when it is needed?
this information
yaml files in zephyr are used for:
binding information related to devicetree hardware description
configuration of test cases
As you have already found, devicetree binding are documented here.
About zephyr test framework read all the details in the official docs
In particular, sample.yaml files located inside the application project directory define tests cases
to be executed by the sanitycheck tool. Read here for more details.

Can I define like a main in sikuri? a way to run a serie of sikuri file one by one automatically

I try to make automatic test on sikuli, I have to many TCs in sikuli files, but I need all the file on sikuli run one by one without human actions, a know I can do a batch or a sukili file who run all the files, but isn't a way to do like a main in a scrip in sikuli?
1) Sikuli can use Python modules syntax. I used it in my practice.
My old module was started like this:
# import
import sys
sys.path.append("/Program Files/Sikuli")
from sikuli.Sikuli import *
# some Sikuli functions further.
Then I imported my module like Python module in Sikuli/Python main routine and used it's functions. So you can put your TC in modules and call them from "Main" module.
2) There was some works on integrating Sikuli into Robot Framework, general purpose testing framework. You can Google them out.
Unfortunately, all that worked with Sikuli versions before 1.0 , and I just don't know how it is going now (there is one developer on Sikuli now and things don't go smooth). In general, the answer is "yes, you can" (other way or another), but I can't give clear full details now.
You could write a shell script with all the commands you would otherwise run manually.
Something like:
#!/bin/sh
sikuli-ide -r sikuli_script1
sikuli-ide -r sikuli_script2
sikuli-ide -r sikuli_script3
And so on. Afterwards just run the script.

Export a jar file from Eclipse or Command Line

This is my first post ever but I intend to use this more often in the future so please be critical if I do something wrong.
I have done research on the topic and have already attempted everything from using the command line to Eclipse's File>export>jar and choosing the appropriate options.
Basically I have attempted everything suggested in the following two links:
Java: export to an .jar file in eclipse
http://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html
The results of my efforts are:
1) a jar file is created
2) when I try to run it the error is "Failed to load Main-Class manifest attribute from test.jar"
I assure you that I have indeed created a "manifest.txt" file in my project that consists of
"Main-Class: Login
"
I even include a newline because I hear that is necessary in some instances.
Does anyone know what I could be missing? Or better yet can anyone please provide an extremely detailed explanation of how to create a jar. This could be either from command line or eclipse.
My current project is setup where I have three java files in my workspace: Login, NewFrame, and NewUser. Login has the main method which will eventually call the other files. These three files are in the default package. The projects name is JavaVersion.
Thanks.
Thank you Antimony for your interest and help. After more tinkering I was able to figure it out for myself. Turns out I was never correctly defining the entry point. For anyone looking to export a jar in Eclipse I would also like to recommend this link.
How do you build a JAR in eclipse with a custom manifest file?

Resources