Run two keywords in Robot Framewok in parallel - appium

I use robot framework with Appium library to automate an application.
I want to test there a graph functionality. When user long presses somewhere on the graph and holds his/her finger the values are shown for that date, as soon as user stops pressing the values disappear.
I tried to Long Press the graph and check that page should contain text or wait until page contains passing the expected text to appear, but the case always fails, as at the time when robot framework starts to check the text it is already disappeared.
So as I understand what I really need is to make two keywords run in parallel. The following two ones:
Long Press 5000
wait until page contains someText
I googled and seems that some time ago there was a way to run parallel keywords, but now they removed it from framework.
So does anyone know how can I test this case or is it possible at all?

Related

All time based triggers seem to run at the same time

I have multiple time based triggers in a google sheet (most of which are supposed to run every 15 minutes and one of which is supposed to run once a day). These scripts that the triggers run simply generate random numbers in specific cells (one per each script/trigger). These cells changing then triggers a script that pulls from an API. The issue is that I can only pull so much from the site's API before it locks me out (60/pulls per minute is the limit). The scripts seems to all run at the same time on occasion (including the one thats supposed to only run once a day) which results in me being locked out of the API and receiving no data. Does anyone know why everything would be running at the same time? This happens when the once a day trigger shouldn't be active too.
For this use case you might be better off chaining your functions.
So you would only schedule functionA(), and at the end of it you call functionB(), and so on.
That also allow you to put a Sleep() function between them if your API requires it.
If every function are in the same project that's straightforward, but if they are in different project you will need to publish your projects as libraries.
It's not pretty but it will do the tricky.

Keeping a Google Doc (Sheet, etc.) last update time

I need to put (among other things) the time of the last update of a Google Document (Doc, Sheet, etc.) in a footer, so that if the document is printed it is possible to distinguish which printed copy is the latest. This needs to be a script so it is done automatically for users without requiring them to do anything special. I have a script that does this (at least for Docs), but there are some issues:
In a Doc there is no onEdit trigger, so I can't determine automatically when the document is updated in order to update the footer. (I am aware that I would need to prevent my own update from triggering this by ignoring the change I make)
onOpen can only update the document if the user has edit access to the document. So if somebody opens the document, edits it, and closes the window, and then another user opens it without edit access, they would see the next to last update time instead of the last update time.
The current version of my script must be manually bound to each document when it is created. Is there some way to have it automatically get bound when new documents are created? Would an add-on work?
Is it possible to use the "Detect Changes" API somehow? I'm not sure this is even going to do what I want, and it seems like it might be complicated to do it this way.
Would a time-driven trigger make sense? The only problem with this is that time driven triggers don't seem to be able to run more than once per minute (unless in an add-on, which can only run once per hour), so that last update time could be off by up to this much. This probably wouldn't be a big problem, but could occasionally cause some issues. Also, would running code every minute cause any kind of quota issues?
I tried using ClockTriggerBuilder with a delay of 1000ms, but it wasn't updating. Then I noticed that the after function says it will run the trigger after the specified number of milliseconds plus or minus 15 minutes!

How to announce to user when a Google Script is completed

On a Google Sheet, I have an extensive OnOpen script (viewable here) to refresh data on several sheets within the workbook. It all takes a while for all script lines to execute, i.e. to import new raw data and to then perform five different Unique Queries against that new data and thus update data on five sheets. When the Google Sheet is opened the user does see two successive pop-up yellow "Working" boxes, then five subsequent progress bars (while each of the queries do their thing). This all takes quite a while. I'd like to make an addition to the script routine to announce to the user that "all data is now refreshed and ready to view." A simple MessageBox ("Data now refreshed') placed at the end of the scripts seems to pop up before all script commands are actually completed. Thus the message box gives misleading info and I think it also interrupts some script lines from executing until "OK" is checked. So, MessageBox doesn't seem to work. So, I'm looking for a way to confirm that all script line (and all unique queries) are, in fact, complete before informing the user that it's OK to start viewing the data. Thanks.
Place a SpreadsheetApp.flush() before the "finished" alert box; the flush() method:
Applies all pending Spreadsheet changes. Spreadsheet operations are sometimes bundled together to improve performance, such as when doing multiple calls to Range.getValue(). However, sometimes you may want to make sure that all pending changes are made right away, for instance to show users data as a script is executing.

Re: Julius Speech Recognition

I am using julius speech recognition for my application. I have one doubt regarding julius:
I have downloaded the latest version and was successful in using its lib and making it work. the problem I am facing is..once the app starts and I call the voice recognition function in my application...it takes the input from mic and displays whatever is said in the mic, but the function still continues to do so again and again. The control will never come out of that function. Here I am facing problem since the control is not returning back I am not able to proceed further. What I want is once the engine gets input from mic it should recognize and stop there.. which I tried to do by deleting the callback function but was unsuccessful.
Can anyone please guide me in this matter, what I need to do to get the desired output. It will be helpful for me.
As discussed in the same post on VoxForge:
You have a couple of choices: first to use the Julius -input control to get the sound data from a list of files (see the .jconf sample file), so that when the list (even if only length one) is exhausted then Julius stops. It is quite easy to record the voice input to a file and then feed the file into Julius. Second you can put a dialog manager in control. If you need more information on what a dialog manager does there are many posts on this forum on that subject accessible by a search.
The basic function of Julius is to start up and then keep on decoding input. When you get more experience you can run Julius as a server, and then tell the server to respond, not respond or shut down as required. It's more efficient than having Julius start and stop all the time.
When an avenue exists for a complex application to yield the required result by using an effective combination of options at run time, editing the application, while possible, might involve a lot of unnecessary work. The emphasis then shifts to passing the options correctly in whatever script is being used to access Julius.

Detect The End Of A Script/Text In Lua

How can I detect in lua if a user has stop typing in a richtext box/object, so as to enable me compare the current text that has been inputed by the user for further implementations? That is, after the user stops typing a text in the richtext object or box, then the text that has just been typed is compared. However, i have manage to carry-out the further implementation part, like the comparison and the actions to be performed, but my problem is how to detect if the user has stop the typing in the richtext box for the other implementation to follow.
I have tried several approaches, but I am still not getting it right.
I'm guessing that you're using a GUI library of some sort to get the richtext box.
What you should look for is a way to see keyboard events. Some GUI toolkits have them. Every time the user presses a key (or there is other input from the keyboard), the OS triggers a Keyboard Event that the program can access. You can use that to tell if the user has entered text. If there is a large pause between events, maybe 2 seconds, you can judge that the user has stopped typing and proceed with the comparisons.
Another way to do it is to look at the contents of the text box. Basically, take a look at contents of the textbox. If they've changed since the last time you've looked, then you should wait a bit and check again. If they haven't changed, assume the user has stopped typing and run your comparison.
Keep in mind that some people type really slowly or may stop to think halfway through typing. This means you can fool yourself if you check too often, and altering the text that the user has just typed where they can see it can scare and confuse the user. (Some GUI toolkits remove the text from a textbox when you read all the data, which means the user just saw all their work disappear!) Just be careful.
Honestly, some details on what you're trying to do would be really helpful. As Mike Corcoran indicated, where this script is running can really change what options you have and what options would work best with the program as a whole. For example, a third solution is to simply ask the user to press a button or otherwise indicate that they have finished typing. This isn't a good idea in a text editor, but it would work in some other GUIs.

Resources