Error encountered: "XPathEvaluator is not defined" when using IEDriverServer and Internet Explorer with Selenium and Java in Microsoft Dynamics CRM

As part of my testing process for a CRM application with Selenium Java, I encountered an issue with a button that opens a new window. When executing the test, a Script Log Error appears in the new window stating,

ReferenceError: 'XPathEvaluator' is undefined at (some http resource)

Interestingly, when performing the same action manually, no error occurs. I am puzzled by the cause of the XpathEvaluator is undefined error.

I would appreciate any insights or suggestions on where to begin investigating this error.

All Xpaths related to clicking the button and opening the window have been verified as correct locators.

The versions I am working with are:

  • Selenium: 3.14
  • IE: 11

Answer №1

When encountering this error message...

The occurrence of a ReferenceError where 'XPathEvaluator' is indicated as undefined

...it suggests that a ReferenceError happened during the process of XML manipulation in Javascript.

In his book Professional Javascript for Web Developers, @nzakas (Wrox Author) discussed the challenges with browsers not supporting the XPathEvaluator. He recommended utilizing specific Document object methods to fill the gap left by those unsupported browsers.

Presently, only does not provide support for XPathEvaluator. For IE, using selectNode() and selectSingleNode() on the DOM Document object instead is recommended.


An Example Scenario

According to an article on Resolving the Error "XPathEvaluator’ is undefined", the script error stating XPathEvaluator is undefined often arises in Microsoft Dynamics CRM 2011 following an upgrade to . Investigation revealed that any HTML asset incorporating ClientGlobalContext.js (used to access parent form context) will trigger the error message

SCRIPT5009: ‘XPathEvaluator’ is undefined
.


Possible Solution

A convenient fix would involve including the following line within the <head> section of your custom HTML files referencing that specific JS file:

<meta http-equiv="X-UA-Compatible" content="IE=10" />

This particular line aims to compel the browser to operate the web resource in mode.

Important Note: It's crucial to highlight that this functionality may be phased out in , which serves as Microsoft’s recent replacement for Internet Explorer.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Determine if a file input is linked in React.js Material UI

Currently, I am working with a Material UI <TextField /> component that has a type=file prop to allow file attachments. My goal is to trigger an event when a file is attached to this TextField. However, my search results only provided JQuery soluti ...

Bootstrap tab toggle feature

I'm currently facing an issue with Bootstrap's tab component. I need help figuring out how to hide a lorem ipsum section and show a hidden div when a specific tab is clicked, and then revert the changes when a different tab is selected. $(func ...

Automated Quote Assignment in Fact Array: A Guide to Automatically Tagging Quotes to Text Lines

Greetings everyone! I recently started delving into android studio and am currently working on an app that showcases interesting facts. Everything is running smoothly, but I have a query - Is there a way to automate the process of adding quotes to each fac ...

Utilizing JQuery for asynchronous calls with Ajax

I recently started working with ajax calls using jquery and I'm facing an issue while trying to bind values from the Database. The data is returned in a dataset from the Data Access Layer, and I am attempting to bind this dataset to a gridview on my . ...

Tips for presenting information from MONGODB in the HTML of ANGULAR 5

It's been a challenge for me since yesterday. I've been working with an API that fetches data from mongodb (mlab.com). var helpers = require('../config/helper.js'); var UserModel = require('../model/UserModel.js'); module.ex ...

Dynatree fails to consider the select feature while utilizing ajax requests

Currently, I am utilizing the dynatree plugin to exhibit a checkbox tree in multi-select mode (mode 3). Upon initializing the tree using ajax (without lazy loading), it appears that certain nodes that were initially loaded as selected are forgotten. When ...

Identifying Changes in ReactJS Pages

As I delve into learning ReactJS, I have been experimenting with various websites that utilize this technology. Presently, my focus is on making an AJAX call to an API based on the URL of a page. The issue arises when clicking a link breaks my code due t ...

Disabling the InfiniteScroll feature when navigating to a new page via AJAX

We are currently utilizing the jQuery Infinite Scroll Plugin on our website. Despite the fact that the plugin is no longer being maintained, it perfectly serves our needs. However, the challenge we are facing is related to our ajax-based site. Whenever the ...

What approach provides the most effective way to navigate through an NPM Package?

I have an idea to enhance a particular open source NPM package. Although I understand the necessary steps, it would be incredibly beneficial to have the ability to debug the package while it is in operation. Is this achievable? ...

Error: An issue occurred in the driver.execute_script function causing a JavascriptException. The error message indicates

When attempting to run some JavaScript code on the Chrome driver, I encountered a JavascriptException. Despite my confidence in the correctness of the JS code, the following error message was displayed: raise exception_class(message, screen, stacktrace) s ...

GraphQL is not capable of fetching data directly from a mysql database

Trying to incorporate GraphQL with MySQL in a Node.js Express server has been my recent challenge. Unfortunately, every time I execute my query, an error surfaces. Here is the specific error message: { "errors": [ { "message&quo ...

How come I am receiving {"readyState":1} in the DOM instead of JSON data in AngularJS?

Currently, I am facing an issue where instead of the JSON data (which consists of only 49 items) showing up on the DOM, I am getting {"readyState":1}. I believe this is just a test to ensure that my code is functioning correctly. Although I have identifie ...

End the selenium browser correctly in Python

Once I execute the following Python script: from selenium.webdriver import Firefox from contextlib import closing with closing(Firefox()) as browser: # some code here I notice that there are lingering geckodriver processes on my Linux machine. $ ss - ...

What is the process by which the search algorithm operates when dealing with objects within a Java collection like HashSet?

My query pertains to objects within a dynamically changing collection. When using the "contains" method, does it compare each object individually every time, or is there a more efficient process at play? With 10000 entries in a collection, one would hope ...

Encountering issues with Yarn Install during production build. Issue states: "Error - [email protected] : The engine "node" does not align with this module"

Currently facing an issue while deploying a ReactJS Project on the PROD environment. The previous command "Yarn install" was working fine, but now it's failing with an error message. The error that I'm encountering is: info [email protected ...

Is there a straightforward method for tallying numbers in mongoose?

Here's the code I've written: Company.count({}, function(err, company) { Checkpoint.count({}, function(err, checkpoint) { Guard.count({}, function(err, guard) { Device.count({}, function(er ...

Retrieve data from the Line Item inventory

I am seeking a way to extract and capture the values of all 'LI' (specificationItem) items from a list. These values are located within the What is the best method to retrieve all the LI values and store them for later use? < ...

What is the best way to access the countryName in the autoComplete feature?

I'm having trouble automating the link that I want to click on. Specifically, I need to enter "na" in the search field and then click on "Nepal" using the list attribute i.e list.get(i).click(). However, I have not been successful in doing so. Any ass ...

Store data in Firebase Storage and retrieve the link to include it in Realtime Database

Utilizing Firebase Realtime Database and Firebase Storage for this application involves uploading images from the pictures array to Firebase Storage. The goal is to obtain the Firebase Storage link for each image, add it to the object pushed into imagesU ...

Prevent unauthorized users from accessing the JSP page

I have designed a JSP page, but I only want users who are logged in as members of my site (with certain session features) to be able to view that page. If someone who is not a member tries to access the page, I want them to be redirected to a custom error ...