ServiceNow and Browser Automation with Selenium (updated)

less than 1 minute read

I created a similar version of this post a few years ago but it stopped working, it is time for an update.

The Challenge

While ServiceNow does have the ATF, sometimes you need an external browser automation tool. Enter Selenium! I wanted something to automate the process of logging in and creating test data. I also didn’t want to create and hold a testing environment, I just want to run a script and make this happen. (Yes, REST API is an also an option, but I wanted something as flexible as what can be done in the UI).

The Solution

Here’s the Python script. Just set your instance url, user and password.

I like to combine jobs like this with Rundeck, so that I can generate test data in my Personal Development Instance with a single button click!

For the Service Portal record producer

The question was asked, can this be done in the Service Portal? The answer is yes, however is it worth pointing out that it is a bit more challenging since ServiceNow can change DOM elements names between upgrades. Discussed here.

Updated:

Leave a comment