How to log google search results in console using robot framework - robotframework

I have tried a couple of approaches, I've been successfully able to launch the browser and search the term. I've tried using for loop but i think I'm missing something.

I am not sure what you are exactly looking for, but to log things from your google search results, you can do this:
${result}= Get text xpath=//*[#id="search"]
Log to console ${result}
Now you can refine this logger with providing an exact xpath of the element/link/text that you want to log with Robot Framework.

Related

Robot framework logs producing duplicate output when used with Unicon

Hi I'm using robot framework with python specifically the unicon(https://pypi.org/project/unicon/) package. When using unicon without robot I do not get duplicate output in the stdout but when using unicon with robot in the logs I get duplicate output. I'm not quite sure what is causing this. The code is exactly the same. I'm not sending commands twice.
Expected each command to appear in the log once as evident in the stdout.
https://i.ibb.co/YBpnSg6/unicon-stdout-output.png
Results from log output:
https://i.ibb.co/K59PjQ2/duplicate-output-robot.png

Commandline option for robot framework to get console output instead of get output logs

How to get robot framework running output in console instead of logs by using command line option?
There is no such option.
You might be able to create something with the listener interface, hooking up at suite/case/keyword level and getting the current output, printing to console filtered info.
Have in mind the logging is excessive - look at a sample output.xml, having that much information in the console may be overwhelming.

How to stop PHPUnit in the middle of tests but still get a list of failures / reports?

We have a test suite that runs 30 or more minutes and it is not uncommon for me to see a situation like this:
I don't generally want to break on a first failure (--stop-on-failure) but in this specific example, I also don't want to wait another 10-15 minutes for the test suite to finish. If I do Ctrl+C, the process stops immediately and I won't see any messages.
I'm specifically interested in the format that PHPUnit uses in the console which I find very useful. For example, logging to a file using --testdox-text produces a nice but not very detailed list. Logging with --log-teamcity is verbose and quite technical.
Is there a way to see "console-like" PHPUnit messages before the test suite fully finishes?
Update: I've also opened an issue in the official repo.
maybe you could register a listener in your phpunit.xml file and implement its addFailure() method to display some info in console or a file...

Is there a way to monitor test log for error string using robot framework?

I am a newbie to robot framework, I just wanted to know if i can monitor my application log for a certain keyword i.e. FAIL, If i find the message i stop test and report failure.
It seems to me that the standard keyword Grep File might be appropriate. In the built in Operating System Library documentation you can find more details. In this SO Answer an example is given.

How do I change what Rational Functional Tester logs?

Recently my company upgraded from RFT 8.1.1.1 to RFT 8.2 and now all of our rational_ft_log.txt files that get generated from tests are at least a dozen times longer than they were before we upgraded.
These files are so much longer now because every little "getProperty on frame" that happens returns a +++Pass, like this:
++ PASS 30-Mar-2011 11:15:43.113 AM getProperty on the Frame
line_number = 50
script_name = DebugCommands.IR2_18_DebugCommands
Anyone know how to get rid of these nasty things?
I have searched exhaustively for RFT options to change, and I have looked a little into writing a plugin to output log files. I can't seem to get IBM to get back to me.
You could write your own plugin, or just create your own custom logging methods in a super helper class. I do that anyway, to give me flexibility to output my logging info to any destination. But to answer your specific question about getting rid of the extraneous getProperty log messages, see the RFT info center:
Logged events such as verification
point failures, script exceptions,
object recognition warnings, and other
additional playback information are
displayed in the playback log results.
From Rational® Functional Tester
version 8.2 and later, the results of
the getProperty() command are also
displayed in the log results. If you
do not require the log event to be
displayed in the playback log, you can
disable the event in the log results.
Before you begin: Ensure that you have
access to modify the ivory.properties
file.
About this task: To disable the
getProperty() log event, you must
modify the ivory.properties file.
Procedure: Open the ivory.properties
file available in the \Functional
Tester\bin\ directory. Add the
following line of code at the end of
the file
contents:rational.test.ft.log.enhanced=false
The fix is available under PMR29716. However, you would have to upgrade RFT8.2 to RFT 8.2.0.1 iFix01 to see it working.
Check the PMR # https://www-304.ibm.com/support/docview.wss?rs=0&uid=swg24029194

Resources