SNOW and Selenium
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 12:47 PM
Greetings.
We are on the San Diego version of Service Now.
I am an admin on our test site and wish to write Selenium Web UI Smoke Tests against our instance.
However when I view source on any page (ie service request, incident, etc) the DOM is not available and my C# code is failing.
Here is an example.
//Incidents Opened
WebElement wei = (WebElement)driver.FindElement(By.LinkText("Incidents Opened"));
//The above line of code returns null but in Chrome F12, I do see the DOM.
What am I missing? Or can't I write Selenium tests against my SNOW instance.
In Advance,
Thanks
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 12:28 AM
Hello Tom,
I am pretty sure that you have already checked this, but throwing some ideas.
If you are opening any record form within ServiceNow Classic UI shell. The record form and list are rendered inside an iframe, identified with gsft_main
Regards,
Arjun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 02:44 PM
I actually posted a solution to your issue here. Although my solution is in python, I think you'll find that it's helpful. Fundamentally you must gain access to the elements via JavaScript.
https://www.seamlessmigration.com/servicenow-selenium-shadown-doms/