How do i select the e.g. first entry in a dropdown list which is created when typing in characters? - selenium

I'm testing the chrome extension "Kantu browser automation" and could use some help in figuring out how to select from a drop down list, when the drop down list is created based upon typed characters.
The website I'm testing on is https://uddannelsesstatistik.dk/Pages/dagtilbud_institutioner.aspx
I've tried to record my way through with no success.
I've tried to use click, but can't select the dropdown-list, since it disappears when attempting to clicking on it.
I've tried ClickAt with Coordinates 262,504 and other coordinates as well. Nothing happens.
{
"Name": "Uddannelsesstatistik - Dagtilbud",
"CreationDate": "2019-2-11",
"Commands": [
{
"Command": "open",
"Target": "https://uddannelsesstatistik.dk/Pages/dagtilbud_institutioner.aspx",
"Value": ""
},
{
"Command": "type",
"Target": "id=dawa-autocomplete-input",
"Value": "Aabakken 1, Rebæk, 6000 Kolding"
},
{
"Command": "clickAt",
"Target": "id=dawa-autocomplete-input",
"Value": "262,504"
}
]
}
Right now, it stops when the characters is typed.
The expected output would be that i typed in e.g. "Aabakken 1" and then select the first entry in drop down list "Aabakken 1, Rebæk, 6000 Kolding".
I'm not that experienced in reading html code and how to specify to select first element in a html list, so i could really use all the references, examples, and all help in general.

I have never used kantu before, but you can use the below xpath to identify the first element of the auto completion drop down and you can click on it.
//input[#id='dawa-autocomplete-input']/preceding::label/following::div[1]/ul/li[1]
Give some(at least 3 seconds) delay before performing click action using the above xpath otherwise you will get an error.
I hope it helps...

Related

How to update the pop-up note via API

I'm trying to update the pop-up note via the API. I can easily update the top box (aka the Note) but I don't see how I go about updating the pop-up section. What's odd to me is that the Note doesn't even appear in the WSE, abut when I send the update it does work.
When I retrieve the record, it also doesn't appear to send the data that I have in the pop-up section, and I'm not even clear how I can add it to the WSE.
I've tried just adding it to the JSON update with a couple different names like this (tried popupnote, notepopup), and that still goes through, but only updates the top box:
"note": {
"value": "Travis Update Test!"
},
"notepopup": {
"value": "Travis Pop update Test!"
},
Anyone know if this is possible?
The answer from Acumatica Support is below. In short you need to add a custom field in the items sectionm for the 2 notes and it works perfectly. When loading the items, if you plan to serialize into this class, add this ?$custom=Item.NoteText,Item.NotePopupText to the end of your url:
{
"id": "2a113b2c-d87f-e411-beca-00b56d0561c2",
"custom": {
"Item": {
"NoteText": {
"type": "CustomStringField",
"value": "Regular note 2"
},
"NotePopupText": {
"type": "CustomStringField",
"value": "Popup note 2"
}
}
}
}

Does SurveyJS have a built-in way to specify "show N questions per page"

We are using Survey Creator to allow our users to build questionnaires. However, we want to keep it simple and we don't want them to have to deal with pagination.
In other words, in the builder, we want to disable pages (showPagesToolbox = false) and have them create a set of questions all on a single page.
When we present this to respondents, we want them to see a single question per page. I.e. Q1 is on page 1, Q2 is on page 2, etc.
Does the SurveyJS library provide a way of handling this situation, i.e. here are all the questions, show them with N questions per page?
There is an option, whch allows you to automatically display one question per page. To enable this you need to set "questionsOnPageMode": "questionPerPage" on the survey level. Here's an example:
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "question1"
},
{
"type": "checkbox",
"name": "question2",
"choices": [
"item1",
"item2",
"item3"
]
}
]
}
],
"questionsOnPageMode": "questionPerPage"
}
This is also configurable through the SurveyJS creator by opening the "Survey Settings" dialog, then going to the "Navigation" section, and finally setting the "Questions on page mode" value.
Unfortunately at this time there is no option to specify N number of questions per page. The documentation for this setting is here.

Docusaurus categories in sidebars.json don't show correctly

I have mutiple (more than 2) categories in the sidebars.json,it only render the first and the last one in the page,I can't find how to fix online. thanks.
Here is a producible repo: https://github.com/nianiaJR/doc-demo
Here is my sidebars.json: https://github.com/nianiaJR/doc-demo/blob/master/website/sidebars.json
I expect all navs config in the sidebars.json show in the page. But only the first and the last one show.
{
"type": "subcategory",
"label": "Quick Start",
"ids": [
"doc1",
"doc2",
"doc3"
]
},
{
"type": "subcategory",
"label": "design-and-architecture",
"ids": [
"doc1",
"doc2",
"doc3"
]
}
You have duplicates ids in a different category. You should not do that. The docs is confused whether 'doc1' belong to quick start or design and architecture
https://github.com/nianiaJR/doc-demo/blob/6323eb2207b63cb53918e677681593a9cda9a08d/website/sidebars.json#L13-L29
In my case I had a file named docker-compose.md with an id=docker-compose. My .dockerignore file contained an entry **/docker-compose.
In this case changing the entry to */docker-compose.yml fixed the issue.

How to SelectFrame dynamically in Salesforce?

I am trying to automate a script using Kantu in Salesforce.
Basically I am going through some dropdown IDs and select the right values and everything works IF the selectFrame value is correct in the beginning.
The problem is that Salesforce refreshes the iframe ID everytime the page is refreshed or a new case is opened (i.e. ext-comp-1018 | ext-comp-1035 | ext-comp-1048 etc.)
Because the script does not recognize the frame (since it is always changing), it won't go ahead to do the rest of the actions.
{
"Name": "SFDC_Auto",
"CreationDate": "2019-3-25",
"Commands": [
{
"Command": "selectFrame",
"Target": "id=ext-comp-1018",
"Value": ""
},
{
"Command": "select",
"Target": "id=cas5",
"Value": "label=Escalation"
},
I seen a post that mentioned this would be the solution, but I am not sure how to implement it in Kantu:
frames = #driver.find_elements(:xpath, '//iframe[starts-with(#id,ext-
comp-)]') #driver.switch_to.frame frames1
So far I could make this work: xpath=//iframe[starts-with(#id,ext-comp-)], however it doesn't do nothing. It reads ok but then halts at the next step saying that ID CAS5 is not recognized.
Can anyone help out?
Thanks,

How to move the cursor to the end of the tag in Sublime Text 2?

When I type the start of a tag, Sublime Text will auto-complete the end of the tag and position the cursor inside the tag.
<code>|</code>
I use | to represent the cursor. So when I finished the contents inside the tag, I want to move the cursor to the end of the tag like this:
<code>blabla</code>|
To do this, now I have to press Right button to move the cursor character by character, which is not efficient. Is there any shortcut to move the cursor to the end of the tag directly?
You could also create a macro. This may be valuable if your tags cover multiple lines. Save the following as something like move_to_end_tag.sublime-macro in Packages/User.
[
{
"args":
{
"to": "tag"
},
"command": "expand_selection"
},
{
"args":
{
"by": "characters",
"forward": true
},
"command": "move"
}
]
You can then create a keybinding for the action.
{
"keys": ["ctrl+shift+alt+right"],
"command": "run_macro_file",
"args": {"file": "res://Packages/User/move_to_end_tag.sublime-macro"}
}
Of course, you can change the keys to whatever you like.
I'm working in Sublime Text 3 rather than 2, but the End button (for me, between the delete and page down) does the trick for me.
I found that annoying as well. Personally, taking the End key binding and applying it to Shift+Space works well enough for my purposes.
If that's easier for you, you can add this line to your user key bindings:
{ "keys": ["shift+space"], "command": "move_to", "args": {"to": "eol", "extend": false} }
Using a macro as skuroda suggested is a good option as well since you end up with more control of the cursor placement.
For curly braces and parentheses you can use Control + M.
Not sure about angle brackets in markup though.