How to set the user define path for log/output/report file of robot framework on command line - selenium

I am using robot framework with pycharm.
I am running all the tests of my folder using
testfolder>robot .
I want to set the path of log/output/report file to my customized location.
I have change the path of screenshot as D:/Screenshot folder in my variables.robot.
But How to set the path for mentioned file?
I also wanted to know
What is the common to run on terminal/cmd to run all the scripts of same folder with defined log file path?

Robot Framework User Guide walks you through the Basic Usage in quite good detail. Additionally the same document contains a section for the Different Command Line Options Available where you can get quite good picture on the options you have available.
Specifically --outputdir or -d will make Robot to save Log.html, Report.html and output.xml to the specified folder.

As mentioned by #Morkkis, the -d or --outputdir would do the trick. Also, it works for both command line and PyCharm Arguments field
For the screenshots, you could use the screenshot_directory command line argument. Please, check the Keyworkd documentation for more details ScreenShot Library Documentation
Also, for the report/logs file location, you can use these variables:
${LOG LEVEL} Current log level.
${OUTPUT FILE} An absolute path to the output file.
${LOG FILE} An absolute path to the log file or string NONE when no log file is created.
${REPORT FILE} An absolute path to the report file or string NONE when no report is created.
${DEBUG FILE} An absolute path to the debug file or string NONE when no debug file is created.
${OUTPUT DIR} An absolute path to the output directory.

Related

How do I change path directory in Jupyter lab?

How do I change initial path directory in Jupyter lab, when i want to get a file via "~/"?
Have tried to generate config, and then change some parameters but only got confused.
You can change file directory like that.
import shutil
File= r'C:\Users\ivan\Desktop\Somewhereidonotknow\example.csv'
Whereyou_want= r'C:\Users\ivan\Desktop\example.csv'
shutil.move(File, Whereyou_want)
You should be using the %cd magic command to change the working directory. And then to set up using tab completion, you'd start by typing ./ before hitting tab at the place where you want to choose your CSV file.
In the demonstration set-up for the screenshot below I made a test directory in the root (home) location and made two CSV files in there.
Using %cd test first I am then able to use tab completion to get the option to select one of the two CSV files:
I probably should have included running pwd to 'print the working directoryafter I ran the%cd test` command to demonstrate things more fully.
Before I executed the command %cd test, the tab-completion was showing the root (home directory) when I tried for tab completion.
The tilde symbol (~) always means the HOME directory on the system. It won't change. So you were always specifying to start in HOME in your example in your post, no matter what the current working directory is in the notebook's active namespace. You want to use relative paths for when the working directory has been adjusted.
There are more complex settings you can take advantage of using inside the notebook in conjunction with the %cd magic.
For example, this post and answer shows how you can use the %boookmark magic to set assign a directory to a bookmark setting and then you can more easily switch around to various directories using %cd.

How to generate report.html for every testsuit( .robot file) in RoboTFramework?

I,m using single pycharm project to run different test files for a particular website.
ex -: I'm having robot files with test cases such as
loginTest.robot , purchasetest.robot , signinwith_facebook.robot
When I run the code for each robot file, the report files are being overridden.
How to generate a separate report file for each .robot file when the test file is running.
Are you using robot command to execute? If yes, you can run with these arguments:
-d --outputdir dir Where to create output files. The default is the
directory where tests are run from and the given path
is considered relative to that unless it is absolute.
-o --output file XML output file. Given path, similarly as paths given
to --log, --report, --xunit, and --debugfile, is
relative to --outputdir unless given as an absolute
path. Other output files are created based on XML
output files after the test execution and XML outputs
can also be further processed with Rebot tool. Can be
disabled by giving a special value `NONE`.
Default: output.xml
-l --log file HTML log file. Can be disabled by giving a special
value `NONE`. Default: log.html
Examples: `--log mylog.html`, `-l NONE`
-r --report file HTML report file. Can be disabled with `NONE`
similarly as --log. Default: report.html
I suggest using -d argument. Indicate a different directory for each .robot file executing.
robot -d test1 test1.robot
BTW, why don't you execute them at the same time? You can see each log in one file.

Error in running trace32 with command line

I have a .cmm file which helps in debugging of Qcomm chipsets.
This file has a line : cd ../../../../../modem_proc
When I run this same cmm file using T32 GUI, it runs fine and does the work. But when I am trying to run the same file using windows command line using,
C:\T32\bin\windows64>t32mqdsp6.exe -c C:\T32\config.t32 -s D:\path\to\xxx.cmm
Following error is thrown in T32: syntax error in B::cd ../../../../../modem_proc
What am I missing here? I have no hands-on experience with T32 what-so-ever.
The problem probably results from different working directories. Type
PRINT OS.PWD()
in the GUI and add it to the top of the script. I'd suspect they are different.
Don't use working directory relative paths, instead use paths relative to the script, e.g.
CD ~~~~/../../../../modem_proc
The four tilde (~) symbols mean "directory of the currently executed script". There's still a possible issue with this solution when using multiple GUIs and the intercom, but for most use-cases this should be OK.
When starting TRACE32 (up to build 99518) without option "-s", it starts a default script t32.cmm form your TRACE32 installation directory. But t32.cmm is not executed, when "-s" is used.
So probably your t32.cmm is changing your working directory. If so you can fix the issue by adding the line
DO ~~/t32.cmm
to the top of your script xxx.cmm.
See also https://www.lauterbach.com/frames.html?help_autostart.html
The default working path is also set by the TRACE32 configuration file. That is the file passed with "-c". So if your are using a different configuration file than C:\T32\config.t32 when starting your TRACE32 GUI the normal way, then you should use that configuration file also when starting TRACE32 from the command line.
To get the path of the configuration file usually used, start TRACE32, execute command AREAand then command PRINT OS.PCF()
Furthermore dev15 is probably right here https://stackoverflow.com/a/53671657/4727717:
Use paths relative to the PRACTICE script (cmm-file) by starting each path with four tildes.

how to pass user properties file to JMETER through commant prompt

I am using JMETER for load testing. I have large number of user properties in my plan. Its not recommended to pass all these through command prompt because of size issues. I am aware that we can put all the properties in some .properties file and use that file. Like we have the user.properties file in JMETER. But I want to make my own properties file and it should be loaded after the jmeter.properties file. Can anyone guide me how I can do that.
I have gone through a link
http://www.testautomationguru.com/jmeter-property-file-reader-a-custom-config-element/
But not getting how are the following steps to be done
Download this zip file which contains a jar file.
tag-jmeter-extn-1.0.zip (784 downloads)
Go to JMETER_HOME/lib/ext foler.
Place the jar file & Restart JMeter.
Once yo launch the JMeter, You will see ‘Property File Reader’ as given below.
Thankyou
I created the plugin. Did you place the jar file in the /lib/ext folder?
If yes, then close the jmeter and launch again. Under Config Elements - you would see Property File Reader. Give the path of the property file to be read.
You can add as many Property File Reader elements as you want for each property file.
If you do not want to use any external plugin, you can simply pass the property files to the test as shown below.
jmeter -n -t test.jmx -p c/path/to/prop.properties
The main idea of using the plugin is to read the user property file during the design phase/GUI as well. Property File Reader will work in both GUI/non-GUI modes.

How to specify output folder for self-extracting ZIP file

extracting ZIP files that have been created using:
PKSFX(R) Version 2.50 FAST! Self Extract Utility for Windows 95/NT 4-15-1998
Is there an option to specify which folder the files contained in the EXE should be extracted to?
By typing "/help" I was able to find some useful options (like Overwrite, Exclude, etc.), but I cannot see anything related to the Output Folder.
Any suggestion?
Thank you!
I found the following over at ousob.com. It appears as part of a larger article which seems to have the documentation for the whole PKSFX suite. It looks like you run the executable and then specify any flags followed by the path to extract to and, optionally, specific named files from within the archive to be extracted if you don't want them all.
PKSFX Command Summary
Command line syntax and options are the same as PKUNZIP. The options
listed below are offered by a self-extracting file.
Syntax: pksfx [option] [d:\path] [file]* [file]*
PKSFX indicates the name of the self-extracting file you are executing.
No options are necessary if you wish to simply extract all files to the
current directory. If you wish to extract the contents to another
directory, indicate the drive and/or path the files should extract to. To
extract only particular files, indicate the name(s) at the end of the
command line.
Options:
#listfile.lst Specify list of files for extraction*
-c[m] Extract to console*
-d Re-create directories stored in .ZIP file*
-l Display software license agreement*
-n Extract only newer files*
-o Overwrite existing files
-p[a|b][c][#] Extract to printer*
-s<password> Decrypt with password*
-t Test file integrity*
* Indicates options not available in the PKSFX Junior and PKUNZIP Junior
programs.
Options should be placed after the self-extracting files name. If
multiple options are used they must be separated by a space and each must
have its own option indicator (either - or /).
All options behave in the same manner as they do with PKUNZIP, with one
exception. The -s option cannot accept keyboard entry. A password
entered with a self-extracting file must be able to be entered from the
command line.