User Interactive Console in Kotlin - kotlin

I'm not 100% sure how to ask this question so sorry if something is wrong or confusing.
I am looking for suggestions on how to print out a list of options like names and allow the user to mark an 'X' next to the name they want to import and leave blank for the name to ignore.
When the text gets printed all the names would be blank by default but the user could scroll up in the console and mark them individually. I am using Kotlin and am not sure where to start.
Jake [ ] // would be ignored
Jacob [X] // would be added

Related

PageNumber in Scripts for ActiveReports 7

I'm not very used to Active Reports and I got an old software using those. The software provide some kind of stripped version of Active Reports Designer 7.
I got a PageFooter section with some fields and I want to remove one to display it only when it's the last page.
Basically, what I want to do is this in scripts :
if (this.PageNumber == this.PageCount) {
Field.Visible = true;
}
I only find one post here that say this.PageNumber should work, but it dosent.
So I tried to use the ReportInfo using the FormatString as {PageNumber}, but I don't seems to be able to read the value using this.ReportInfo.Value or this.ReportInfo.Text
I also tried to make a TextBox, using SummaryType : PageCount. But I'm still unable to read the Value.
So the question is :
How can I know the Page Number and Page Count in the script section?
Or how can I read the value of those textbox I created ?
Thanks a lot!
I think these docs cover what you are looking for:
https://help.grapecity.com/activereports/webhelp/Legacy/AR7Help/OnlineEN/AddPageNumbering.html
https://help.grapecity.com/activereports/webhelp/Legacy/AR7Help/OnlineEN/index.html

Watson Assistant retaining the value that is a recognised entity

I am capturing a user response in my assistant, after which I want following questions to repsond based in the response that has been previously captured into an entity i have created
For example I will respond to a question with
Banana this is captured as an entity
I then want the watson assistant to then respond to subsequent question based on the entity captured. For example I want to ask
What colour ? and for the assistant to know that Im asking the question in relation to the banana, as I know that some people interacting with the assistant won't ask the question "what colour is a banana ?"
What you are asking is one of the reasons (as #data_henrik mentioned) we have context variables. These once set will remain through out the conversation. You can set a context variable using either the context editor ( see three dot menu of a dialog node ) or in the json response packet i.e.
"context": {
"my_saved_entity" : #entity_defined
}
In your case #entity_defined = banana so "my_saved_entity" becomes banana.
You can then use this context variable in your response;
The colour of a $my_saved_entity is Yellow
And you can text for a setting of $my_saved_entity in the dialog condition i.e.
(if) $my_saved_entity = "banana" or the short hand version $my_saved_entity:banana
I would suggest you read the following documentation, and have a play
https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-runtime#dialog-runtime-context-variables

Special characters in drop-down list with Robot Framework (Selenium)

just wondering if any of you know how to handle special characters with a website that contains a drop-down list. I scripted the following in Robot Framework (Selenium) to verify the contents of a drop-down list:
Verify all required fields and labels are present
Verify a and lists of b for 'ööö'
Verify a and lists of b for '${xyz}'
(...)
Dropdown "{abc}" should contain options "${json_blabla["ABC"]["${xyz}"]}"
However, when trying to do that, I get the following error message when running the script:
Resolving variable '${json_blabla["ABC"]["ööö"]}' failed: KeyError: '\xc3\xb6\xc3\xb6\xc3\xb6'
Any idea how to get around this? I'm sure I saved everything in UTF-8 encoding, and I think the JSON file should be fine too, so I'm suspecting it's somewhere in the script I just showed?
Found it:
It seems that it needs to be told explicitly that the string must be in Unicode, so one option to have it corrected is:
Dropdown "{abc}" should contain options "${json_blabla["ABC"][u"${xyz}"]}"
And voilà!
Thanks for voting & until next time!

verifyText using *text* instead of verifyTextPresent (deprecated)

I'm kind of new to selenium IDE and automated test and I don't know much about programming languages. I have a question concerning verifyText command as verifyTextPresent is deprecated. If I put the target word/text in * * will it work as if I was using verifyTextPresent? Could waitForText work?
I am trying to verify that the search function of a website is working as expected. I search the word "client" and I want to verify that the word is present in the results.
clickAndWait css=div.cf-tooltip-text
type id=edit-global-search client
clickAndWait id=edit-submit-global-search
verifyText id=content-column *client*
This works, but in the Log I can not understand what it really does. Also if I try the word on its own "client" I get an error which I understand because it compares it to the text of the whole column. I also tried to put an irrelevant word between asterisks such as youwillnotfindthetext (just to make sure that everything between asterisks will pass the test) and there I had an error too.
So it seems to be working somehow but I want to ask some of you expert guys.
Thanks
If you put a * in starting and ending means it will look for the inner text containing in the specific element. If a text is present as you given in the script it will return a pass. If the text u specified in the script is not present, it will throw an error. That's what happens when you put youwillnotfindthetext in between the *.
Check this link Selenium: test if element contains some text

how to show button if there are two roles Lotus Formula script

I have a Page in Lotus, which has an action button.
This button must be not visible when user is not part of role Admin or Supervisor.
The way i did this is by adding this formula:
#IsNotMember("[Admin]"; #UserRoles) | #IsNotMember("[Supervisor]"; #UserRoles)
But it does not work..
If I have only 1, like: #IsNotMember("[Admin]"; #UserRoles) And the role Admin, then as admin I can see it.
But I also would like to have that if user is from role Supervisor and not Admin that he still can see the button.
What to do?
Knut's answer is correct. My answer shows why, and gives an approach to hide-whens that almost always makes them easier to figure out.
Notes has been using hide-when formulas forever, but people really tend to think in terms of see-when in their requirements! We know when we want to see things (when we're Supervisors or Admins in this case). And we're really bad at turning those see-when requirements into hide-when formulas because we're really bad at remembering DeMorgan's Law, which says things like: ^(P & Q) == (^P | ^Q)
So if we state the requirement this way:
Hide when the user isn't a Supervisor or an Admin
we tend to have trouble turning it into the correct formula with two #IsNotMember calls (which are implicitly logical Nots), because we forget that Ors have to turn into Ands in order to get it right. But if we think of it this way:
See when the user is an Admin or the user is an Supervisor
It's easy to see how to express it:
#IsMember("[Supervisor]"; #UserRoles) | #IsMember("[Admin]"; #UserRoles);
Or using the power of formula language lists, we can shorten that to this :
#IsMember("[Supervisor]": "[Admin]" ; #UserRoles);
To turn that into the equivalent hide-when, all you need to do is put a logical Not around it like this:
! (#IsMember("[Supervisor]": "[Admin]" ; #UserRoles));
You can do that with any see-when formula - just surround it with parenthesis and put a ! in front of it, but in the special case of a formula that just uses #IsMember, you can just change it to #IsNotMember, which brings it back to Knut's solution.
Formula
#IsNotMember("[Admin]" : "[Supervisor]"; #UserRoles)
returns #True if user has neither role "[Admin]" nor "[Supervisor]". Use this as hide-when formula for your button. Only Admins and Supervisors will see the button then.