The UiAutomator output is currently displayed in CMD prompt.
When i run the tests the output is displayed in Command prompt.How to export this to .txt file/html file.
You could use something like:
adb shell "uiautomator runtest test.jar -c test_class" >> file.txt
The above code appends the output into file.txt
We can convert the console output results into standard junit xml result by using the following github project.
https://github.com/dpreussler/automator-log-converter
Usage
Initially redirect your output to text file format as mentioned above.
With automator-log-convertor:
Build the jar file with the ./gradlew jar command
Run java –jar path-to\automator-log-converter-1.0.0-SNAPSHOT.jar path-to\output.text where the path to the uiautomator jar file will be in build/libs/ directory
This will convert the text file format to standard junit xml format.
Related
I want to try out the Taurus framework to run my existing jmeter scripts. I usually run my scripts from the CLI like this:
jmeter -n -p .\config.properties -t .\HTTPS-REST\Done\load-scenario.jmx -l .\HTTPS-REST\TestResults\load-scenario-log.jtl
With the above command, I am loading a properties file which is necessary to populate some constant values in the jmeter script and I am logging all requests in a .jtl file as the test runs.
How can I achieve the same result with Taurus ?
With regards to .properties file there are several ways to handle it:
In your home directory there is a Taurus' special folder where it keeps downloaded tools called .bzt so you can rename your config.properties file to ~/.bzt/jmeter-taurus/x.x.x./bin/user.properties file and it will be picked up on next execution
If you switch to YAML test plan definition to run existing .jmx script you will be able to convert .properties to YAML format like:
modules:
jmeter:
properties:
property1: value1
property2: value2
#etc.
and then specify it via included-configs section
Individual properties or location of the included-configs or both can be set/overriden via -o command-line argument like:
bzt -o modules.jmeter.properties.property1=value1 -o modules.jmeter.properties.property2=value2 test.jmx
Results file is available in the artifacts directory, it is called kpi.jtl
More information:
Taurus - Command Line Tool
Navigating your First Steps Using Taurus
The following link Adding-JMeter-Properties shows how add properties while executing the script using Taurus.
The JTL file will be available for download after the execution is done.
In windows, using the command "jmeter -n -t [test JMX file] -l [test log file] -e -o " to generate the dashboard result doesn't execute and shows the error.
You have at least 2 problems:
first ensure that you have a Java 7 or 8 installed and that this command works:
java -version
second, change your current directory to be in the jmeter_home\bin folder (C:\Users\Freeware Sys\Documents\apache-jmeter-3.0\bin) ad run command from there
Please follow below steps to generate report dashboard instead of using jmeter.log file.
Add Simple Data Writer from Listeners.
Provide your path, where you want to generate like it could be in csv file or xls file etc.
Note: Remember one thing you should not create a file whether it could be csv,xls etc file because Simple Data writer automatically creates the Test results file as provided location.Then simple run your test plan and try to generate report dashboard with command prompt with generated Test Result file. You can read more configurations here.
Here it has given complete step by step details for generating Report Dashboard in Jmeter.
I need to Extract the contents of the Jar in to a specific location. When I run the below command to extract jar,it works correctly.
jar -xf location/ex.jar
The same command I placed inside a script(.sh/.ksh).When I run the script, I get the below error :
jar: not found.
Both the user are same from which I run the script/command. I am using AIX server.
Thanks for Your help.
Your PATH variable isn't set correctly.
Find your java installation : find / -name "java"
Add the correct path to your PATH variable : export PATH="$PATH:/location/to/java/jre/bin"
Or, just use unzip /location/ex.jar
I have got a scenario in which I have got two files in a folder.One is .jpg format and other is .xmp format.I have to zip this folder.That means the final zip folder will contain both of these files.Is there is any way to zip them together in bw,without using java function.
Thanks in Advance.
You can use a Java code activity you won't have to add any libraries as the java natively can manipulate the Zip archives .. check this Appending files to a zip file with Java
You can invoke it as a system command like gzip mm/* in the External command activity
specify the script as the command to run in the External Command activity. The script runs the desired command and returns the process ID of the process it started. The return code of the script is stored in the return Code item of the External Command activity's output.
I hope this could help!
I run a unixODBC installation script in a maven pom.xml file and it has the following output.
Run the command 'cd /tmp/unixODBC.30048.28312.21379/unixODBC-2.3.0; make install' to install the driver manager.
How do I capture the text inside the '' above, e.g., cd /tmp/unixODBC.30048.28312.21379/unixODBC-2.3.0; make install, and then execute it? The /tmp/unixODBC* directory name changes everytime.
you could pipe your maven output to
mvn ...|grep -oP "(?<=')[^']*(?=')"|sh
without the ending |sh you could check if the captured the commands chain correct.