I am trying to automate click interactions with the ServiceNow application using the web automation package. I have watched a number of videos regarding this package and have tried the following different options with no success.
- Tried using the recorder (this was not using Web Automation Package but was unsuccessful as the objects did not list all of the properties and I could not get the click interactions to work)
- Tried using Web Automation: Click > Search By Element Xpath > Click
- Tried using Web Automation: Click> Search By Element ID > Click
- Tried using Web Automation: Click > Search By Tag Name > Click
- Tried using document.querySelector()
- Tried using document.querySelectorAll()
- Tried using document.getElementByID
- Tried using document.getElementsByName
- Tried using document.getElementById('sys_original.x_eyit2_dsr_dsr_task.dsr_case').value
- This returns a unique sys_ID that I can use as follows
- BaseURL + sysID to navigate where I want….but the webpage behavior is inconsistent
- Sometimes when I type this in the google developer tools console it will work and other times it will not
- When it works I notice in the console that before it works it says "dirty form focus"
Attaching a few images of the google developer tools console to get the unique sys_id....
- Tried using document.getElementById('x_eyit2_dsr_dsr_task.number').click()
- This will click the button properly however it is inconsistent as I have mentioned above. It seems to work intermittently in the google developer tools when I fiddle around with the website or use google developer tools > inspect element but has never worked when I run it in the Automation Anywhere Control Room
See Below Unsuccessful click.... However if I fiddle around with the website or use google developer tools > inspect element....sometimes it will work in the console (It has never worked in Automation Anywhere Control Room...)
Build number – 4.0.0-beta-2, revision 4ec0cfc112
Environment - (Prod/Dev/UAT/Staging etc.)UAT
Deployment - (On-Prem/Cloud)Cloud
Operating System Used - (Win10/Server & Enterprise/Professional)Windows 10 Enterprise 10.0.19044 Build 19044
Bot Agent Version – 21.222
Most probably, you are not targeting the correct iframe? Developer tools > inspect element > highlighting element is auto selecting correct frame for console and works ?
You could also use Servicenow REST API to get data/ automate.
"Developer tools > inspect element > highlighting element is auto selecting correct frame for console and works ?'
It will not work.....
However, after this initial command does not work if I click a few places on the page or if I do this:
Developer tools > inspect element > highlighting element
This is what I mean by the website being inconsistent.
Can you please provide more information on the Servicenow REST API and how to use it in practice?
Does anyone have any insight into how to get web automation to work properly based on the above scenario? I see the web automation package specifically mentions service now in the description. I feel like I'm definitely barking up the right tree, but I need some guidance....
Any help would be much appreciated.