Protractor Cucumber : how can I capture web driverjs errors in cucumber html report - protractor

I was about to use cucumber-html-report plugin to generate the html reports for my framework but I noticed that the report doesn't print the errors which I see on the Command line- for example -"an element not found for locator..".Rather it prints the time out errors. How can I capture the actual errors that I see on the Command line.
Any advice??
Cheers

you can use the tee command to save the Command line - output to a file while also seeing it on command line
cucumber (+options) | tee -a logFile.txt
It's not as pretty as an html report, but it probably gives you the additional information you want for debugging in an extra file.

Related

Cannot redirect EXE output to file

I have an exe program I'm running on Windows 10 using PowerShell. When I run it, I get the following output.
> .\Program.exe
Unlocked level 7/10
When trying to redirect all output or just stdout to a file, the program stops giving output. For example
PS > .\Program.exe > .\out.txt
PS > cat .\out.txt
PS >
I did not write the program but what I know is that it was written in C++.
Is there any trick to get the output into a file? I tried running in python and writing output to a file, running in python without fetching the output and redirecting, running from another powershell, and lots of other combinations but they don't seem to be working. Also, when running from Git Bash, I get no output at all.
I was thinking about some checks on the descriptors but I'm not sure since I don't have the source code, only the asm code
It looks like Program.exe is actually generating an error, and not output, first commenter is trying to get you to see that, but not really explaining that part...
(NOTE: You aren't actually using any powershell besides an implied "Invoke-Expression")I think you might be dealing with STDERR vs. STDOUT, when I invoke reg.exe in that fashion from powershell I get no output to the text file. This is because the text I was seeing was an error message ( Contents of STDERR ) from reg.exe, not the output ( contents of STDOUT ) from the command. When I passed proper parameters to it ( reg query HKLM\Software\Microsoft > C:\Users\foo\Documents\foo.txt) it wrote the Contents of STDOUT to the text file instead of the screen.
Here is an article that explains it better than I just did:
https://support.microsoft.com/en-us/help/110930/redirecting-error-messages-from-command-prompt-stderr-stdout

TexStudio and TexCount User Command

Im trying to incorporate TexCount into Tex Studio.
Ive gotten the perl script working in the command line, but I would like it done in TexStudio automatically.
I have adapted a bat file, but it doesnt work:
#echo off
C:\texlive\2015\texmf-dist\scripts\texcount\texcount.pl -html -inc "?ame" > "%".html
"%".html
However I tinker with the syntax it doesnt seem to work and at the very most I can get it to produce a blank html file "_count.html"
Can anybody get this .bat file working please?
I've managed to get it working using the TexStudio User Commands.
In the Menus,
Options > Configure TeXStudio
Then,
Build > User Commands
I created my own user command with the name "texcount".
texcount %.tex -inc -total
This runs the texcount script;
on the current file (that's what the % is for),
it includes the files that use \input{},
it provides a total.
I can now run this command from:
Tools > User > (Number of user command: name of user command) e.g. 1:
texcount
Then the results are output in the messages tab.
Hope that helps.
EDIT: To more specifically produce a html file. I imagine you could use the html commands to produce your html file as shown in Thomas' answer.
You could then pipe the output to something like wkhtmltopdf to produce a pdf from the html file and show it using the default TeXstudio pdf viewer.
I could get this to work on my mac, you may need some adjustments for other OSs and/or other directory structures.
I created a script that calls texcount, as follows:
#!/bin/bash
perl /CorrectPath/texcount.pl -v0 -sum -html "$1*" >tempdoc.html
open tempdoc.html
In TexStudio, my user command looks like this:
"/CorrectPath/count_pdf_words.sh" ?ame"

cvs annotate and standard error redirection

First, some background. I'm trying to use cvs annotate within a Perl script invoked from a ksh command line to find out who's using bad hex constants in their source code and dole out justice appropriately. I'd like to use stdout for this program strictly for my own structured output, so I can pipe it to a file or to other programs. But, every call to cvs annotate results in a diagnostic message being printed to the console. It takes the form of:
Annotations for <filename>
***********
It's mucking up my stdout! I played around with annotate on the command line, and I figured that these diagnostic messages were coming from stderr, because running this command directly in ksh:
cvs annotate <filename> 1>yay.txt 2>boo.txt
correctly puts the desired annotated output into yay.txt and the diagnostics into boo.txt. However, things get weirder when I try to run this from within a perl script using backticks.
$muhstring = `cvs annotate $filename 2>boo.txt`;
The desired annotated output does appear in $muhstring, but the diagnostics still get printed to the command line, and boo.txt is created as an empty file. There's an admittedly old post on perlmonks.org that says this syntax should work as written. So, what's the deal? Is this a CVS quirk, have I misread the post, or have things changed since 1999? Or is it something else?
Edit: So, it is not, in fact, mucking up stdout. I tried this in ksh:
perl findbadhexowners.pl badhex.txt > out.txt
and the diagnostic messages still printed to the console, but out.txt only contains the annotations. This is fine for my purposes, and I can continue with other code.
That said, it seems like Perl and cvs specifically are interacting a little strangely, especially considering that redirection in ksh works fine and redirection in Perl for other commands like cd works fine - for example, in Perl
`cd nonexistentDir 1>stdout.txt 2>stderr.txt`;
gives the expected output in both stdout.txt and stderr.txt. It's only using cvs annotate from within Perl that produces this problem.

No output from DOMPDF

I am trying to run DOMPDF from a windows command line. I am using the documentation from the domPDF website as a reference. DOMPDF usage
C:\>php -f C:\dompdf\dompdf.php -- C:\example.html
When I run this command I get nothing. No pdf, no errors, noting. I have tried using the -v and the -d flags to turn the verbosity up. I still get no output, neither to the screen or the command line.
When I run,
C:\>php -f C:\dompdf\dompdf.php -- -l
I actually get a listing of the paper sizes, so PHP is installed and I am correctly calling the dompdf php file.
Does anyone have any ideas on why this would not actually produce output?
The html file is on the C: and has information in it.
Does anyone have any example of running DOMPDF from the command line, or see what I am doing wrong?
Thanks for the help.

Output selenium test result as html after running perl script

I am currently looking for a way to output the test result nicely after running selenium perl script.
The htmlSuite command from running selenium server outputs a nice html format result page, but I don't know how to do that in perl script.
Problem is, I have it setup so that Selenium is being run 24/7 on a virtual machine workstation(Windows 7), where anyone one can run tests on. Therefore I can't use htmlSuite to run the test because the server will close after the test is finished.
Is there a command argument or perl script method to make selenium server output results on html or other nice format other than printing it on the command line?
Or is there a better way to do this?
If your script is output TAP (that's what Test::More would put out), then you can use the Test::Harness family of modules to parse that TAP and use it to generate an HTML report.
How nice is nice? Under Hudson/Jenkins this gives graphs and a tabular report of tests run:
prove --timer --formatter=TAP::Formatter::JUnit large_test.t >junit.xml