Xebium, fitnesse & Selenium Pause - fitnesse

Im currently using Xebium, which is allows Selenium to be used with Fitnesse testing.
In Selenium i can set a pause for 3000 milliseconds. When i look at the source code for fitnesse it has the following line :
| do | pause | on | 3000 |
However when i run this test in fitnesse it doesn't wait for 3 seconds liek i thought it would and goes on to the next line instead.
I need the pause for the screen to load a button properly.
I think fitnesse has a problem with seleniums use of pause or interrupts it another way.

I tried this and it worked:
ensure | do | pause | on | 3000 |
I know it's been more than two years but I hope this will help people like me who have just started working on Xebium. Cheers

A bit late, but for future visitors: Have you tried waiting for the button to appear? Selenium documentation suggests doing this:
Many Actions can be called with the “AndWait” suffix, e.g. “clickAndWait”. This suffix tells Selenium that the action will cause the browser to make a call to the server, and that Selenium should wait for a new page to load.
Found at http://seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese

Related

PEPPER (SoftBank Robotics): ALSpeechRecognition Engine issue - How to restart it when it doesnìt work?

During my test on Pepper, I found some difficulties in realizing continuative collaborative dialog.
In particular, after about 10 minutes, it seems that the ALSpeechRecognition engine stops working.
In other words, Pepper dialog panel remains empty and/or the robot does not understand my words, even if the structure worked some minute before.
I tried to stop and restart it (i.e., the engine) via SSH terminal, by using:
qicli call ALSpeechRecognition.pause 1
qicli call ALSpeechRecognition.pause 0
It should restart the engine according to the guidelines shown here, but it does not work.
Thank you so much guys.
Sincerely,
Giovanni
According to the tutorial, starting and stopping the speech recognition engine is done by subscribing/unsubscribing it.
The recommended way to do this is unsubscribing and subscribing back to it. For me it also worked changing the speech reco language and chaging it back to the one you had previously.
Luis is right and to do so just create a function as below given and call it if ActiveListenning event comes false from ALSpeechRecognition module. Note: Use ALMemory module to get data from ALSpeechRecogntion.
asr_service = ALProxy("ALSpeechRecognition",ip,port)
memory = ALProxy("ALMemory",ip,port)
def reset():
asr_service.unsubscribe("ASR_Engine")
asr_service.subscribe("ASR_Engine")
ALS = memory.getData("ALSpeechRecognition/ActiveListening")
if ALS==False:
reset()

How to fetch the test result and code coverate stats in fastlane to notify else where?

Am using fastlane for my app and right now have configured to generate HTML reports for tests & code coverage.
Is it possible to fetch the stats as seen on command line so that I could use it to notify on separate chat app which I use ?
+------------------+---------+
| xcov Coverage Report |
+------------------+---------+
| 123456789012.app | 100.00% |
+------------------+---------+
+--------------------+---+
| Test Results |
+--------------------+---+
| Number of tests | 1 |
| Number of failures | 0 |
+--------------------+---+
You can use tools like xcov and gcovr to gather coverage data on top of fastlane. Links are as follows to the documentation:
https://docs.fastlane.tools/actions/gcovr/
https://docs.fastlane.tools/actions/xcov/
For test results, i believe there is no straight forward answer for that because the logs you see in the console are not directly exposed by Xcode.
When you are running your application, Xcode creates a file called TestSummaries.plist, which has all the steps and results.
Some of the developers were in your position, where they ended up writing a macOS application, just to parse the plist and get all the data. Following is the reference to the project.
https://github.com/nacuteodor/ProcessTestSummaries
https://github.com/KrauseFx/trainer
Lastly, go through the following article which explains how test logs are structured in the testSummaries.plist
https://michele.io/test-logs-in-xcode/
Hope all the links and explanations help you out. :)

VISUAL DATAFLEX How can I get the exit code of Runprogram

Im launching a DOS program using Runprogram wait "command plus args" wich exits with 1 whenever an error happends and 0 when everything works as expected...
Problem is, I'm unable to catch that exit code.
I have tryed using ShellExecuteA but dataflex wont wait for it to close...
I have also tryed to use Chain Wait without any possitive result.
I'm using VDF 18.2 my App is a desktop app.
I finally found the answer which is working like a charm. Seems to be that DataFlex has this "magic variable" called strmark which is cleaned and filled everytime I issue the command Runprogram Wait ('program') ('args').
So at the end of the day we can do something like this:
Runprogram Wait ('program.exe') ('my args')
If strmark Showln ('Well, we have an error my friend... Exit code: ' + strmark )
Else ...
This works like a charm when the program itself has a problem or even if the user closes the Command prompt window.

Access nsIDOMChromeWindow from Services.jsm or similar, for XUL to Add-ons-SDK migration

Migrating an old Add-on from XUL to Add-ons-SDK in preparation for WebExtensions. Would still like to support some older browsers with this add-on, so that is why I am not jumping right to WebExtensions.
What I'd like to do is control minimize, maximize full screen and restore functions. These seem to be implemented right on the window object, since FF 45.0, which is great, but no help when trying to support older browsers. Not sure if that functionality existed before, or how to access it in a XUL-migration friendly context ( Step 1: use Services.jsm ). See Migrate from XUL Overlay to Restartless.
To best I could find is to use Components.interfaces.nsIDOMChromeWindow.windowState of the STATE_* attributes to detect the minimized, maximized, normal or fullscreen states, and then issue the methods minimize(), maximize() and restore() found on the same object ( nsIDOMChromeWindow ).
But I can't seem to find the precise way to load the equivalent
Components.interfaces.nsIDOMChromeWindow.windowState
using a resource:// like Services.jsm.
For example, the old add-on also used:
Components.interfaces.nsIPrefBranchInternal
which was later renamed to
Components.interfaces.nsIPrefBranch2
and later folded into
Components.interfaces.nsIPrefBranch
which can now be accessed by:
Components.utils.import( 'resource://gre/modules/Services.jsm' );
var prefsService = Services.prefs;
See Services.jsm on MDN for options.
| Service accessor | Service interface | Service name |
|-------------------|----------------------|-------------------------|
| domStorageManager | nsIDOMStorageManager | DOM Storage Manager |
| DOMRequest | nsIDOMRequestService | DOMRequest service |
| wm | nsIWindowMediator | Window mediator service |
| ww | nsIWindowWatcher | Window watcher service |
There's two things that start with nsIDOM* (Request and Storage), but don't seem to be related, or have any path to the desired object. nsIWindow* (Mediator and Watcher) both have some methods that return a similarly named nsIDOMWindow object (deprecated in FF 44), including a confusingly named getChromeForWindow() method, but that is NOT THE SAME OBJECT, and indeed, doesn't have any of the desired state attributes or window management toggle methods.
I am not sure what I am missing here. Is this simply one of the things the developers decided was "low level" and thus refused to provide any high level access via Services.jsm? Or is the access there but documentation incomplete? Or is it documented but buried? Or is it blogged about somewhere? I could only find one single post on all of StackOverflow that even had nsIDOMChromeWindow in it!
As I initially stated, I know there's a simple way to do this in both the "old" style XUL/Overlay, as well as the "new" FF >= 45, but I am looking to support that in-between area, at least for another year or two, until they absolutely drop XUL. By then, I will have the Add-ons-SDK version ready to go, and the WebExtensions well underway.

echo from php "as it goes"

what was the way to print results from a php script while it's printing stuff before the script ends? i tried to play with output buffer, putting sleep() between echos to test but the result is always showed after the script executes. Is it a browser-side thing too?
All you could do in your PHP script to try to flush all the current output to the user's browser is a call to ob_flush, but it actually depends on many other things as well.
The HTTP server has its own buffering, and the browser may not instantly render every packet it receives. It's like a long pipeline of buffers at different levels that all have to be flushed before you see anything in the browser, and the PHP output buffer is at the highest level.
yes you can do that this way
<?php
echo "hello senad";
flush();
sleep(20);
echo "meskin";
?>
PHP is server side. If you are making a web page, then the results will ALWAYS be shown on the client after the script ends and has been transmitted.
If you are running the script on your own computer, then I heard somewhere that one prints during execution and the other after the script is done. Try switching between print and echo and see how your results go.
There are 2 solutions:
1) Deactivate the output_buffering in php.ini
2) When using loops use this for example:
for ($i = 1; $i <= 3; $i++) {
echo md5(rand())."<br />";
flush();
ob_end_flush();
sleep(1);
}
PHP loads a page all at once then displays it. Use flush() to show output as the script loads.
Nice question.. when I want to do something like that (like loggin actions) I just use AJAX. And I know it's not probably what you wanted but hear me out.. I have had this problem as well 4 times so far and I've used AJAX and because of that I was able to put a preloader (which is really cool and helpful :))
By "use ajax" I mean if you have 4 actions to show up do 4 ajax requests. I know it's not the most elegant solution (as you do a lot of extra stuff) but it is a good design-wise solution.

Resources