Can't reference an utterence file in botium - chatbot

I am new to botium and my developer (not me) has created a framework with conversation text files that I should be able to run botium scripts on.
An example is something like this:
#me
What are the stats for my neighborhood?
#bot
There are ten matches in your neighborhood
When I run this test in my IDE, it passes. So, I created a text file called NEIGHBORHOOD_UTT which has sentences similar to the following:
What are the stats for my neighborhood
Show me neighborhood stats
Neighborhood
And then changed my convo.txt file to:
#me
NEIGHBORHOOD_UTT
#bot
There are ten matches in your neighborhood
All these I've tested on the app through the GUI and should return "There are ten matches in your neighborhood"
The error is something like: TranscriptError: BotiumError: neighborhood/Line 6: Expected bot response (on Line 3:
#me - NEIGHBORHOOD_UTT) "Sorry, I couldn't find any listings for" to match one of "There are ten matches in your neighborhood."
The GUI is not responding with "Sorry, I couldn't find any listings", but the expected response. There is no API documentation for me to check there. I can't share too much as this is work/proprietary. Both the utterences and the convo txt are in a folder called botium
I have tried naming the file both NEIGHBORHOOD_UTT.utterances.txt and NEIGHBORHOOD_UTT.txt
I cannot think of anything else so I have searched github for random projects similar to mine and haven't found any that provided any clues

The first line of an utterances file is the utterance reference code. For example:
USER_HELLO_UTT
hi
hello
nice day
USER_HELLO_UTT can be used in convo files then:
Say hello
#me
USER_HELLO_UTT
#bot
Hi!
More examples available in the Botium Wiki

Related

Migrating from itext2 to itext7

Years ago, I wrote a small app in itext2 to gather reports on a weekly basis and concatenate them into one PDF. The app used com.lowagie.text.pdf.PdfCopy to copy and merge the PDFs. And it worked fine. Performed exactly as expected.
A few weeks ago I looked into migrating the application to itex7. To that end, I used the copyPagesTo method of com.itextpdf.kernel.pdf.PdfDocument. When run on the same file set, this produces warnings like:
WARN PdfNameTree - Name "section.1" already exists in the name tree; old value will be replaced by the new one.
When I click on the link to "section.1" in the first document of the merged PDF, I am taken to "section.1" of the last document. Not what I expected and not what happens when using the itext2 app. In the PDF's produced by itext2, if I click on the link to "section.1" of the first document in the combined PDF, I am taken to section 1 of the first document.
There is a hint in Javadocs for copyPagesTo saying
If outlines destination names are the same in different documents, all
such outlines will lead to a single location in the resultant
document. In this case iText will log a warning. This can be avoided
by renaming destinations names in the source document.
There is however, no explanation of how this should be done. I find it odd that this should be necessary in itext7, although it wasn't in itext2.
Is there a simple way to get around his problem?
I've also tried the Sejda desktop app and it produces correct results, but I would prefer to automate the process through a batch script.
My guess is iText 2 didn't even know it might be a problem.
If iText can't deduplicate destination names, the procedure is roughly:
Follow /Catalog -> /Names -> /Dests in each document to find the destination name tree.
Deduplicate the names, by adding suffixes. Remember that a name with a suffix added might be equal to an existing name in the same or another document. Be careful!
Now you can rewrite the destination name trees. Since you have only used suffixes, you can do this in place - the lexicographic ordering of the names is unaltered so the search tree structure is not broken.
Now, rewrite destination links in each PDF for the new names. For example any dictionary entry with key /Dest, or any /D in a /GoTo action.
Now, after all this preprocessing, the files will merge without name clashes.
(I know all this because I've just implemented it for my own PDF software. It's slightly hairy stuff, but not intractable.)
If you like, I can provide a devel version of cpdf with this functionality, if you would like to test it.

How to export Test Cases with all the steps assigned to a test case in?

I have a project that contains different Work Items types. I would like to export the Test Cases but I would also like to see all steps of the test case in nice visual way. In some example I have up to 3 - 4 steps for a test case.
Currently, I can export them, but they are not displayed properly.
To give you a clear example, what I have for a test case in my Excel File is this:
Open test bookTest book opens in EditorModify the book by adding a topicTopic added to book in book structureSave the book and close itBook saved with added topic appearing when opening it again.
What I would like to have is this:
1. Open test book
2. Test book opens in Editor
3. Topic added to book in book structure
4. Book saved with added topic appearing when opening it again.
I can perform the modification of the file manually, but it will take too long time.
Any idea on how I can do this ?

testcase failed when getting variable output from bot using botium box

I am using botium-box. I have the following convo file:
Here the date is a variable and changes everyday so I have to change it everyday in convo file otherwise the testcase is failing.
I have tried few solutions:
setting SCRIPTING_ENABLE_MEMORY to true in advance settings and using
placeholder for variables. For eg.
I tried setting INTENT_CONFIDENCE to 70 in advance settings and using
in convo file. For eg:
I tried INTENT_CONFIDENCE directly in convo file without setting it in advance capabilities. For eg.
I tried using %s in place of variable. For eg.
Testcases are still failing. Is it a bug? Do I have to change any Botium settings? How can I do partial matching of responses?
Solution 1 should be working (see here and here). If it doesn't work, please attach log file for analysis.
Options 2 and 3 are for something totally different (verification of intent resolution confidence), and Option 4 is not a Botium feature.
What you can try as well: Botium by default does substring matching for assertions, so your convo file could look something like this:
#me
what is the date today ?
#bot
Today is

Undefined parameter in Google Action

I have a DialogFlow agent I am trying to test on Google Assistant. I've created a relatively simple Intent called "Set name" with the following Training phrases:
My name is Ryan.
Bill
I'm Steve
The name's Bond. James Bond.
It has two parameters:
Required: given-name with the Entity #sys.given-name and the value stored as $given-name
last-name with the Entity #sys.last-name and the value $last-name
I'm able to test in just fine in the DialogFlow test console. But when I try to "See how it works in Google Assistant." I get the following error:
Request contains an invalid argument. The query pattern 'The name's
Bond. $SchemaOrg_Person:given-name $SchemaOrg_Person:last-name.'
contains an undefined parameter 'last-name.'
If I delete the "James Bond" training phrase, it works okay. But I would like to include that. What am I doing wrong?
Here is a screenshot of the intent that is causing the problem:
Here is the link I'm clicking to try in Google Assistant:
And finally, here is the error message that appears in the bottom-right corner of the screen when I click that link:
I suddenly got a few of these error messages when both clicking the "See how it works in Google Assistant" link and submitting the app for production.
It seems like characters like apostrophes and hyphens in the training phrases creates trouble and can give that error message.
In addition it complained about a variant of the training phrases that I could not find anywhere no matter how much I looked at all languages, all pages of the phrases and all intents. I finally found the phrase in question by exporting the project and searching through the JSON files. Then I could delete the phrase locally, delete the intent in Dialogflow and do an import back to Dialogflow. (From my understanding it had messed up a follow-up intent which it also in the JSON (nowhere in the UI) had attached parts of some training phrases.)
Try to remove the dot from the sentence. So it will be:
"The name's Bond. James Bond"
I ran into same error and finally it was found to be an issue with the additional language I have added.
There was default "en" language and "en-IN" added by me. The issue was with training phrases in "en-IN" language. I didn't need it so removed it and it worked fine.
So, do check how many languages are enabled in your agent and whether training phrases are set properly for them or not.

Kodi (fka Xbmc) scraper for onlinetvrecorder (otr) recordings

I would like scrape information for recordings from onlinetvrecorder (otr) in Kodi. Unfortunately the scrapers available can't handle the file format which is like
Django_Unchained_15.07.03_22-45_sf2_165_TVOON_DE.mpg.mp4.avi
Renaming is not an option, since the filename is a key for otr. I know there is a scraper called xbmc-otr, but it never left beta status and seems to be outdated.
Any suggestions, on how to correctly display those files in Kodi?
Has anybody written or started a scraper for otr?
After some research I found a solution to the problem. Put the following in %appdata%\Kodi\userdata\advancedsettings.xml (advancedsettings.xml does not exist in advance, you have to create it)
<advancedsettings>
<video>
<cleanstrings action="prepend">
<regexp>_\d\d\.[0-1]\d\.[0-3]\d_[0-2]\d-[0-5]\d_</regexp>
</cleanstrings>
</video>
</advancedsettings>
The regexp <regexp>_\d\d\.[0-1]\d\.[0-3]\d_[0-2]\d-[0-5]\d_</regexp> matches the timestamp in the otr filename, so that everything right of the match (at the end of the file name) is removed. See the official Kodi documentation for further reference. The remaining file name can be handled by the scrapers shipped with Kodi.
Despite of the relatively coarse regexp I added, all my otr movies were recognized correctly.
The solution is tested with Kodi 15.2 (Isengard), but should work with all versions that support the cleanstrings option.
EDIT:
A similar soltuion works for TV Shows. The only requirement is that the file name contains season and episode information like S01E02 for example.
<tvshowmatching action="prepend">
<regexp>_[Ss]([0-9]+)[Ee]([0-9]+)([^\\/_]*)</regexp>
</tvshowmatching>