JS Library for Web Communication
Following are the features of JS library for Web app communication over the localhost:
- Allow to connect any Web App over loopback address (127.0.0.1)
- Execute automation and get the automation response
- Reset automation client
Prerequisite
Following are the prerequisites for JS Library for Web Communication:
- Application with which ae-w2a-bridge library is being used should be deployed in Engage webserver. Deploy/Add the library from BUILD_ROOT/AddOns/web/ae-w2a-bridge/ae-w2a-bridge.js.
- If application is deployed outside Engage domain, set AllowedOrigin property in client exe config file.
Browser Support
The supported web browsers are Chrome, and Microsoft Edge.
API Exposed by library
- initAutomationEnv(callbackFunc)
This method will initialize automation environment and connect with automation client.
If initialization fails:
{"Status":"Unable to initialize environment."}
- getEnvStatus(callbackFunc)
This method will return the connection status. If its connected or not.
{"Status":"CONNECTED","Data":"7/23/2021 7:42:20 PM"}
{"Status":"DISCONNECTED"}
- getUserselection()
This will return user’s selection on automation client’s sign-in screen. Selected profile and processes will be returned.
If Users selection is called without initializing environment
{"Error":"Environment not initialized"}
Sample Response:
[
{
"SearchInputs": [
"inputField1"
],
"Applications": [
"ExeEmpSignIn"
],
"ProcessName": "ExeEmpSignInCview",
"ProfileName": "ExeEmpSignInProfile"
},
{
"SearchInputs": [],
"Applications": [
"ExeEmpSignIn"
],
"ProcessName": "ExeEmpSignInProcess",
"ProfileName": "ExeEmpSignInProfile"
},
{
"SearchInputs": [
"InfyId"
],
"Applications": [
"InfyDirectory"
],
"ProcessName": "PythonWithWebApp",
"ProfileName": "SanityTest"
}
]
- performAutomation(automationObject, callbackFunc)
This should perform the automation and return response.
sample automationObject
{"processName":"notepadAutomation","profileName":"testProfile","searchInput":{"inputText":"123"}}
If performAutomation is called without initiation environment.
{"Error":"Environment not initialized"}
Sample Response
{
"Status": "SearchSuccessful",
"Output": {
"outputField2": "123"
}
}
Status Values:
- SearchFailed
- SearchSuccessful
- SearchTimeOut
- SearchInProgress