How to use If command in the selenium ide? - selenium

I was searching the web for a long time. I'm trying to put if and else statements into this selenium IDE. The program itself doesn't provide any parameters, hints, or help. I saw a lot of results online where it's just java code, however I don't see anyway to enter code here.
Can someone show me an example of how to use this if and then statement?

Basic if condition example:
Example .side file. Save the below code in file with name as 'Test.side' and open in selenium ide
{
"id": "92a8cfe0-a7ed-45a4-82c2-59f889cba0a6",
"version": "1.1",
"name": "test",
"url": "",
"tests": [{
"id": "f78b739a-886c-4842-9d61-f83700ef29f6",
"name": "test",
"commands": [{
"id": "ff43b0cf-7207-4599-8f11-3f90102cd1e2",
"comment": "",
"command": "open",
"target": "https://in.yahoo.com",
"targets": [],
"value": ""
}, {
"id": "12efa973-069b-4254-9813-868d4a34876d",
"comment": "",
"command": "storeTitle",
"target": "",
"targets": [],
"value": "title"
}, {
"id": "abde904f-6f3f-4a5a-b24a-59c3b2eafe2c",
"comment": "",
"command": "if",
"target": "${title} != 'Google'",
"targets": [],
"value": ""
}, {
"id": "bb6640f2-6356-439f-b226-287030e8fa5a",
"comment": "",
"command": "open",
"target": "https://www.google.com",
"targets": [],
"value": ""
}, {
"id": "ee3b8144-4981-460d-b707-e925e52ebe41",
"comment": "",
"command": "assertTitle",
"target": "Google",
"targets": [],
"value": ""
}, {
"id": "f73c9836-4944-45aa-be07-9647991ffb36",
"comment": "",
"command": "end",
"target": "",
"targets": [],
"value": ""
}, {
"id": "bcc2bd2b-5091-4b40-b499-f89c38e532bf",
"comment": "",
"command": "sendKeys",
"target": "name=q",
"targets": [],
"value": "Hello world"
}]
}],
"suites": [{
"id": "e966e7ba-8ccd-418a-80e7-f99ac6c25f90",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["f78b739a-886c-4842-9d61-f83700ef29f6"]
}],
"urls": [],
"plugins": []
}
If with else Example
Example .side file.
{
"id": "92a8cfe0-a7ed-45a4-82c2-59f889cba0a6",
"version": "1.1",
"name": "test",
"url": "",
"tests": [{
"id": "f78b739a-886c-4842-9d61-f83700ef29f6",
"name": "test",
"commands": [{
"id": "ff43b0cf-7207-4599-8f11-3f90102cd1e2",
"comment": "",
"command": "open",
"target": "https://www.google.com",
"targets": [],
"value": ""
}, {
"id": "12efa973-069b-4254-9813-868d4a34876d",
"comment": "",
"command": "storeTitle",
"target": "",
"targets": [],
"value": "title"
}, {
"id": "abde904f-6f3f-4a5a-b24a-59c3b2eafe2c",
"comment": "",
"command": "if",
"target": "${title} == 'Google'",
"targets": [],
"value": ""
}, {
"id": "bb6640f2-6356-439f-b226-287030e8fa5a",
"comment": "",
"command": "echo",
"target": "I am in Yahoo Page",
"targets": [],
"value": ""
}, {
"id": "ee3b8144-4981-460d-b707-e925e52ebe41",
"comment": "",
"command": "assertTitle",
"target": "Google",
"targets": [],
"value": ""
}, {
"id": "f73c9836-4944-45aa-be07-9647991ffb36",
"comment": "",
"command": "else",
"target": "",
"targets": [],
"value": ""
}, {
"id": "a90e7c75-911a-46cb-ac52-a3fd394e6dfe",
"comment": "",
"command": "echo",
"target": "I am in already in google Page",
"targets": [],
"value": ""
}, {
"id": "2b29d6fe-a670-4349-be18-794e85fbd498",
"comment": "",
"command": "end",
"target": "",
"targets": [],
"value": ""
}, {
"id": "7f8ee438-4dae-4f34-b4b6-7a4a166acabf",
"comment": "",
"command": "sendKeys",
"target": "q=name",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "e966e7ba-8ccd-418a-80e7-f99ac6c25f90",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["f78b739a-886c-4842-9d61-f83700ef29f6"]
}],
"urls": [],
"plugins": []
}
If with ElseIf Example
Example selenium ide test file (.side)
{
"id": "92a8cfe0-a7ed-45a4-82c2-59f889cba0a6",
"version": "1.1",
"name": "test",
"url": "",
"tests": [{
"id": "f78b739a-886c-4842-9d61-f83700ef29f6",
"name": "test",
"commands": [{
"id": "ff43b0cf-7207-4599-8f11-3f90102cd1e2",
"comment": "",
"command": "open",
"target": "https://www.google.com",
"targets": [],
"value": ""
}, {
"id": "12efa973-069b-4254-9813-868d4a34876d",
"comment": "",
"command": "storeTitle",
"target": "",
"targets": [],
"value": "title"
}, {
"id": "abde904f-6f3f-4a5a-b24a-59c3b2eafe2c",
"comment": "",
"command": "if",
"target": "${title} == 'Google'",
"targets": [],
"value": ""
}, {
"id": "bb6640f2-6356-439f-b226-287030e8fa5a",
"comment": "",
"command": "echo",
"target": "I am in Yahoo Page",
"targets": [],
"value": ""
}, {
"id": "ee3b8144-4981-460d-b707-e925e52ebe41",
"comment": "",
"command": "assertTitle",
"target": "Google",
"targets": [],
"value": ""
}, {
"id": "f73c9836-4944-45aa-be07-9647991ffb36",
"comment": "",
"command": "elseIf",
"target": "${title} != 'Yahoo'",
"targets": [],
"value": ""
}, {
"id": "a90e7c75-911a-46cb-ac52-a3fd394e6dfe",
"comment": "",
"command": "echo",
"target": "I am in google Page",
"targets": [],
"value": ""
}, {
"id": "2b29d6fe-a670-4349-be18-794e85fbd498",
"comment": "",
"command": "end",
"target": "",
"targets": [],
"value": ""
}, {
"id": "bcc2bd2b-5091-4b40-b499-f89c38e532bf",
"comment": "",
"command": "echo",
"target": "I am out side the if condition",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "e966e7ba-8ccd-418a-80e7-f99ac6c25f90",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["f78b739a-886c-4842-9d61-f83700ef29f6"]
}],
"urls": [],
"plugins": []
}

Related

How To Filter Postman API Results

I am running this GET API query in Postman - https://[myDomain].atlassian.net/wiki/rest/api/space/ which returns the below results.
However, I'd like to filter out the results to display or return only some specific data, e.g. only the id, key, name, homepage and webui values. How can I achieve this in Postman?
{
"results": [
{
"id": 98430,
"key": "DOC",
"name": "Documents",
"type": "global",
"status": "current",
"_expandable": {
"settings": "/rest/api/space/DOC/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=DOC",
"identifiers": "",
"permissions": "",
"icon": "",
"description": "",
"theme": "/rest/api/space/DOC/theme",
"history": "",
"homepage": "/rest/api/content/98633"
},
"_links": {
"webui": "/spaces/DOC",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/DOC"
}
},
{
"id": 425986,
"key": "~63be918f98bf50328c68aec2",
"name": "MyDocs",
"type": "personal",
"status": "current",
"_expandable": {
"settings": "/rest/api/space/~63be918f98bf50328c68aec2/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=~63be918f98bf50328c68aec2",
"identifiers": "",
"permissions": "",
"icon": "",
"description": "",
"theme": "/rest/api/space/~63be918f98bf50328c68aec2/theme",
"history": "",
"homepage": "/rest/api/content/426171"
},
"_links": {
"webui": "/spaces/~63be918f98bf50328c68aec2",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/~63be918f98bf50328c68aec2"
}
},
{
"id": 2064386,
"key": "~5f7af04cb61f66006f28fafc",
"name": "Content Management",
"type": "personal",
"status": "current",
"_expandable": {
"settings": "/rest/api/space/~5f7af04cb61f66006f28fafc/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=~5f7af04cb61f66006f28fafc",
"identifiers": "",
"permissions": "",
"icon": "",
"description": "",
"theme": "/rest/api/space/~5f7af04cb61f66006f28fafc/theme",
"history": "",
"homepage": "/rest/api/content/2064576"
},
"_links": {
"webui": "/spaces/~5f7af04cb61f66006f28fafc",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/~5f7af04cb61f66006f28fafc"
}
},
{
"id": 98306,
"key": "~5f7aef9c8d88b300751faba5",
"name": "AI Development",
"type": "personal",
"status": "current",
"_expandable": {
"settings": "/rest/api/space/~5f7aef9c8d88b300751faba5/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=~5f7aef9c8d88b300751faba5",
"identifiers": "",
"permissions": "",
"icon": "",
"description": "",
"theme": "/rest/api/space/~5f7aef9c8d88b300751faba5/theme",
"history": "",
"homepage": "/rest/api/content/98389"
},
"_links": {
"webui": "/spaces/~5f7aef9c8d88b300751faba5",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/~5f7aef9c8d88b300751faba5"
}
},
{
"id": 229380,
"key": "SD",
"name": "Software Development",
"type": "global",
"status": "current",
"_expandable": {
"settings": "/rest/api/space/SD/settings",
"metadata": "",
"operations": "",
"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=SD",
"identifiers": "",
"permissions": "",
"icon": "",
"description": "",
"theme": "/rest/api/space/SD/theme",
"history": "",
"homepage": "/rest/api/content/229464"
},
"_links": {
"webui": "/spaces/SD",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/SD"
}
}
],
"start": 0,
"limit": 25,
"size": 5,
"_links": {
"base": "https://xxxxxx.atlassian.net/wiki",
"context": "/wiki",
"self": "https://xxxxxx.atlassian.net/wiki/rest/api/space/"
}
}
IMO, you can't directly filter results to show in postman response tab.
However, you can achieve your goals by 2 work-arounds.
Use visualization function:
Put this code to your Tests tab
var template = `
<table bgcolor="#FFFFFF">
<tr>
<th>id</th>
<th>key</th>
<th>name</th>
<th>homepage</th>
<th>webui</th>
</tr>
{{#each response}}
<tr>
<td>{{id}}</td>
<td>{{key}}</td>
<td>{{name}}</td>
<td>{{_expandable.homepage}}</td>
<td>{{_links.webui}}</td>
</tr>
{{/each}}
</table>
`;
pm.visualizer.set(template, {
response: pm.response.json().results
});
Use logging function:
Put this code to your Tests tab
const res = pm.response.json().results;
res.forEach(e => {
let x = {
"id": e.id,
"key": e.key,
"name": e.name,
"homepage": e._expandable.homepage,
"webuid": e._links.webui
}
console.log(x)
})

Selenium IDE detect when an "always present" element is visible

I am using Selenium IDE 3.17.2 on Chrome 106.0.5249.62, to write test login for a Citrix page.
The first time you log into Citrix Workspace, it prompts you have to click a button/link "Detect Citrix Workspace app":
In the IDE, I can click the button just fine, but the next time the test runs, that button will no longer be presented, so I am trying to check for it. If I find it, click it (and click another link afterwards), if not assume we are logged in and look for the logoff button. After some searching, I settled on "store xpath count" to detect the button. That works great, but then I discovered that the element is always on the page, even if the button is not visible:
Now I have no idea what to do. Below is my test (with the URL, username, and password obfiscated), any ideas?
{
"id": "4ad6c3fa-d1a6-4904-8044-8c24afddcbc2",
"version": "2.0",
"name": "Login",
"url": "https://myurl.com",
"tests": [{
"id": "b4bc2240-d614-4924-bb6c-a6b6bfec2012",
"name": "Login",
"commands": [{
"id": "508e91e8-46de-44cf-9f79-18fbfe3bf6e0",
"comment": "",
"command": "open",
"target": "/index.html",
"targets": [],
"value": ""
}, {
"id": "04950822-f2ca-4bbc-8b11-93ae6370d3f6",
"comment": "",
"command": "waitForElementPresent",
"target": "id=Enter user name",
"targets": [],
"value": "30000"
}, {
"id": "38285c96-1015-437f-b0d4-b5dcaca7a7c6",
"comment": "",
"command": "type",
"target": "id=Enter user name",
"targets": [
["id=Enter user name", "id"],
["name=a2331596497617277", "name"],
["css=#Enter\\ user\\ name", "css:finder"],
["xpath=//input[#id='Enter user name']", "xpath:attributes"],
["xpath=//form[#id='vpnForm']/div[2]/div[2]/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "<username>"
}, {
"id": "9d214279-4c2b-4f4f-8d0a-e543b7a2f20c",
"comment": "",
"command": "click",
"target": "id=passwd",
"targets": [
["id=passwd", "id"],
["name=a7843188983724988", "name"],
["css=#passwd", "css:finder"],
["xpath=//input[#id='passwd']", "xpath:attributes"],
["xpath=//form[#id='vpnForm']/div[3]/div[2]/input[2]", "xpath:idRelative"],
["xpath=//div[3]/div[2]/input[2]", "xpath:position"]
],
"value": ""
}, {
"id": "cab3aa5d-3135-407b-9e19-67425a6e8f23",
"comment": "",
"command": "type",
"target": "id=passwd",
"targets": [
["id=passwd", "id"],
["name=a7843188983724988", "name"],
["css=#passwd", "css:finder"],
["xpath=//input[#id='passwd']", "xpath:attributes"],
["xpath=//form[#id='vpnForm']/div[3]/div[2]/input[2]", "xpath:idRelative"],
["xpath=//div[3]/div[2]/input[2]", "xpath:position"]
],
"value": "<password>"
}, {
"id": "548fc696-d596-48b1-9e3d-7fd56c24e316",
"comment": "",
"command": "click",
"target": "id=Log_On",
"targets": [
["id=Log_On", "id"],
["css=#Log_On", "css:finder"],
["xpath=//input[#id='Log_On']", "xpath:attributes"],
["xpath=//form[#id='vpnForm']/div[5]/div[2]/input", "xpath:idRelative"],
["xpath=//div[5]/div[2]/input", "xpath:position"]
],
"value": ""
}, {
"id": "f3097827-cded-437a-ad6b-ad687620b325",
"comment": "",
"command": "storeXpathCount",
"target": "xpath=//button[#id=protocolhandler-welcome-installButton]",
"targets": [],
"value": "detectAppButton"
}, {
"id": "5cbc7df3-3849-4de2-92b4-e62c4e58ece9",
"comment": "",
"command": "echo",
"target": "\"Detect app button count: ${detectAppButton}\"",
"targets": [],
"value": ""
}, {
"id": "8327726c-2c65-48c5-a718-17a02bfda510",
"comment": "",
"command": "if",
"target": "${detectAppButton} != 0",
"targets": [],
"value": ""
}, {
"id": "abf1c098-4cfb-427d-8f8b-6d7857053580",
"comment": "",
"command": "click",
"target": "id=protocolhandler-welcome-installButton",
"targets": [
["id=protocolhandler-welcome-installButton", "id"],
["linkText=Detect Citrix Workspace app", "linkText"],
["css=#protocolhandler-welcome-installButton", "css:finder"],
["xpath=//a[contains(text(),'Detect Citrix Workspace app')]", "xpath:link"],
["xpath=//a[#id='protocolhandler-welcome-installButton']", "xpath:attributes"],
["xpath=//section[#id='protocolhandler-welcome']/div/div/div/div/a", "xpath:idRelative"],
["xpath=(//a[contains(#href, '#')])[75]", "xpath:href"],
["xpath=//section[15]/div/div/div/div/a", "xpath:position"],
["xpath=//a[contains(.,'Detect Citrix Workspace app')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "69099a3c-f063-4e1c-a0b4-c7738fd1b7b7",
"comment": "",
"command": "click",
"target": "id=protocolhandler-detect-alreadyInstalledLink",
"targets": [
["id=protocolhandler-detect-alreadyInstalledLink", "id"],
["linkText=Already installed", "linkText"],
["css=#protocolhandler-detect-alreadyInstalledLink", "css:finder"],
["xpath=//a[contains(text(),'Already installed')]", "xpath:link"],
["xpath=//a[#id='protocolhandler-detect-alreadyInstalledLink']", "xpath:attributes"],
["xpath=//section[#id='protocolhandler-detect']/div/div/div/div/div/a[3]", "xpath:idRelative"],
["xpath=(//a[contains(#href, '#')])[80]", "xpath:href"],
["xpath=//div/div/div/div/a[3]", "xpath:position"],
["xpath=//a[contains(.,'Already installed')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "ca01a29c-c81e-41e7-b5a1-f2353e41f2eb",
"comment": "",
"command": "end",
"target": "",
"targets": [],
"value": ""
}, {
"id": "0e38face-2b4e-4e0b-8d33-f51d1135f66e",
"comment": "",
"command": "waitForElementPresent",
"target": "css=.embedded-settings-icon-svg",
"targets": [],
"value": "30000"
}, {
"id": "40c7f091-d764-4cdc-afbb-dcd33fb63a2b",
"comment": "",
"command": "click",
"target": "css=.embedded-settings-icon-svg",
"targets": [
["css=.embedded-settings-icon-svg", "css:finder"],
["xpath=//a[#id='userMenuBtn']/div", "xpath:idRelative"],
["xpath=//div[3]/div[2]/a/div", "xpath:position"]
],
"value": ""
}, {
"id": "ca625f05-8e4c-4e89-b86c-7a7bc34eb8d0",
"comment": "",
"command": "click",
"target": "id=dropdownLogOffBtn",
"targets": [
["id=dropdownLogOffBtn", "id"],
["linkText=Log off", "linkText"],
["css=#dropdownLogOffBtn", "css:finder"],
["xpath=//a[contains(text(),'Log off')]", "xpath:link"],
["xpath=//a[#id='dropdownLogOffBtn']", "xpath:attributes"],
["xpath=//section[#id='home-screen']/div[2]/header/div[3]/div[2]/div/div[2]/a[3]", "xpath:idRelative"],
["xpath=(//a[contains(#href, '#')])[27]", "xpath:href"],
["xpath=//div[2]/div/div[2]/a[3]", "xpath:position"]
],
"value": ""
}, {
"id": "217d8cec-6440-4640-9abd-c384295220ea",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "36dd9aa5-f61d-408d-98c8-2773d1e7a4e2",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["b4bc2240-d614-4924-bb6c-a6b6bfec2012"]
}],
"urls": ["https://apps.successwareasp.com/"],
"plugins": []
}

How to map an array within an array and achieve the following output?

In the given input,
{
"editable": true,
"sections": [
{
"title": "Identification",
"calingaKey": "",
"content": [
[{
"name": "Classification",
"text": "Product",
"url": "",
"info": ""
},
{
"name": "Product Number",
"text": "####1234",
"url": "",
"info": ""
}]
]
},
{
"title": "Position and Contact",
"calingaKey": "",
"content": [
[{
"name": "Manufacturer",
"text": "Value of Manufacturer",
"url": "",
"info": ""
},
{
"name": "Hardware Version",
"text": "####1234",
"url": "",
"info": ""
}]
]
}
]
}
"content" is an array of array of objects. Basically, the "name" field has to be replaced by values stored in their corresponding keys in the "calinga" variable.
I could do it for the "title" field, but each "name" field should also be replaced by it's name in the variable.
%dw 2.0
output application/json
var calinga = {
"Identification": "Identifikation",
"Position and Contact": "Positions und Contacts",
"Classification": "Classifikation",
"Product Number": "Produkt Number",
"Manufacturer": "Manufakturer",
"Hardware Version": "Hware Vsion"
}
---
{
"editable": payload.editable,
"sections": payload.sections map(item01, index01)->{
"title": calinga[item01.title],
"content": item01.content map(item02)->(item02)
}
}
How Can I achieve the following output?
{
"editable": true,
"sections": [
{
"title": "Identifikation",
"calingaKey": "",
"content": [
[{
"name": "Classifikation",
"text": "Product",
"url": "",
"info": ""
},
{
"name": "Produkt Number",
"text": "####1234",
"url": "",
"info": ""
}]
]
},
{
"title": "Positions und Contacts",
"calingaKey": "",
"content": [
[{
"name": "Manufakturer",
"text": "Value of Manufacturer",
"url": "",
"info": ""
},
{
"name": "Hware Vsion",
"text": "####1234",
"url": "",
"info": ""
}]
]
}
]
}
You can use mapObject() once you descend from the last nested array into objects. Then the trick is to use the value of calinga but if it null because the key is not present then use the original value as the default: item03 mapObject {($$):calinga[$] default $}.
Example:
%dw 2.0
output application/json
var calinga = {
"Identification": "Identifikation",
"Position and Contact": "Positions und Contacts",
"Classification": "Classifikation",
"Product Number": "Produkt Number",
"Manufacturer": "Manufakturer",
"Hardware Version": "Hware Vsion"
}
---
{
"editable": payload.editable,
"sections": payload.sections map(item01, index01)->{
"title": calinga[item01.title],
"content": item01.content map(item02)->(item02 map(item03)-> item03 mapObject {($$):calinga[$] default $})
}
}

Transferring ownership of NFT(ERC721)

I'm trying to change the ownership of a requested ERC721(NFT) to another wallet.
I'm using the Mumbai Test Net and ethers.
To do it I need to create the general ERC721 contract using its abi but I can't find it.
In comparison, the ERC20's abi I found easily - link and used it like followed and it's working:
const createERC20Contract = (contractAddress) => {
const provider = new ethers.providers.Web3Provider(ethereum);
const signer = provider.getSigner();
const ERC20Contract = new ethers.Contract(contractAddress, ERC20ABI, signer);
return ERC20Contract;
}
Where can I find the abi of ERC721 to create the ethers.Contract() ?
Here's a generic ERC721 ABI that I built from the OpenZeppelin implementation. (The bare minimum contract - none of their extensions such as mint and burn tokens.)
[
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "tokenURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

Bot duplicates user messages when I use DirectLine channel

I am using bot framework v4. I have developed a chatbot using .Net Core. The bot is integrated with LUIS and Qna Maker. One issue I am facing is that the bot duplicates the message that comes from the user. Please look at the screenshot below:
The replies I get from the bot are perfectly fine. The flow of the bot is as intended. I just cannot figure out why the message from user is being duplicated. I am using DirectLine for this. I will share whatever code part is needed.
{
"activities": [
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000000",
"timestamp": "2019-12-02T19:41:57.1284328Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://i.imgur.com/ViaEUnA.png"
}
]
}
],
"horizontalAlignment": "Center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "Welcome to CIVIC Financial Services",
"wrap": true
},
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "I am S.U.E",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "I can help you answer your questions. Familiarize yourself with CIVIC Financial Services.",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "If you want to talk to a Customer Service Agent, just type \"I want to talk to a Customer Service Agent\".",
"wrap": true
}
],
"separator": true,
"horizontalAlignment": "Left"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"data": {
"action": "aboutCivic"
},
"title": "About CIVIC"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "We are open from Monday through Friday from 8:00am to 6:00pm.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "When are you open?"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"size": "stretch",
"url": "https://i.imgur.com/gBVgI25.png",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "AZ, CA, CO, FL, GA, HI, NC, NV, OR, SC, TN, TX, UT, VA & WA",
"wrap": true
}
],
"style": "emphasis"
},
"title": "Do you have an office near me? "
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "8 to 10 days, it all depends on how it takes to get access to the property.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "How quickly can we close? "
}
],
"style": "emphasis"
},
"title": "FAQs"
}
]
}
}
],
"entities": [],
"replyToId": "8WGOnspSxN3"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000001",
"timestamp": "2019-12-02T19:43:39.96502Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"entities": [
{
"type": "ClientCapabilities",
"requiresBotState": true,
"supportsListening": true,
"supportsTts": true
}
],
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000002",
"timestamp": "2019-12-02T19:43:41.7278914Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000001"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000003",
"timestamp": "2019-12-02T20:00:25.784598Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "helo",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000004",
"timestamp": "2019-12-02T20:00:26.5739342Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000003"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000005",
"timestamp": "2019-12-02T20:00:27.3293896Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hello",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000006",
"timestamp": "2019-12-02T20:00:27.6064185Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Hello",
"inputHint": "acceptingInput",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000005"
}
],
"watermark": "6"
}