diff --git a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
index d309c4cfd..93971eb86 100644
--- a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
+++ b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
@@ -313,7 +313,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
                     self.driver.find_element_by_css_selector(
                         'div.pgadmin-explain-container > svg > g > g > image'
                     )
-                ).perform()
+                ).click().perform()
                 break
             except Exception:
                 if idx != 2:
@@ -326,8 +326,8 @@ class CheckForXssFeatureTest(BaseFeatureTest):
                     )
                     raise
 
-        source_code = self.driver.find_element_by_id(
-            'toolTip').get_attribute('innerHTML')
+        source_code = self.driver.find_element_by_css_selector(
+            '.pgadmin-explain-details:not(.d-none)').get_attribute('innerHTML')
 
         self._check_escaped_characters(
             source_code,
diff --git a/web/pgadmin/misc/static/explain/js/explain.js b/web/pgadmin/misc/static/explain/js/explain.js
index da595e6b3..c478288b8 100644
--- a/web/pgadmin/misc/static/explain/js/explain.js
+++ b/web/pgadmin/misc/static/explain/js/explain.js
@@ -947,7 +947,10 @@ define('pgadmin.misc.explain', [
         IMAGE_WIDTH,
         IMAGE_HEIGHT
       );
-      image.attr({style: 'cursor: pointer'});
+      image.attr({
+        style: 'cursor: pointer',
+        class: 'image-node',
+      });
 
       // Draw tooltip
       var image_data = this.toJSON(),
@@ -1478,6 +1481,10 @@ define('pgadmin.misc.explain', [
             }
           });
         });
+        container.find('.image-node').tooltip({
+          title: gettext('Click for details...'),
+          template: '<div class="tooltip" role="tooltip"><div class="arrow d-none"></div><div class="tooltip-inner"></div></div>'
+        })
       });
 
       _renderExplainTable(ctx._explainTable, explainTable);
