I'm testing a GWT + SMARTGWT application and I'm trying to locate the elements of this web application using Selenium Webdriver. The method which I have used to locate the elements is by the relative XPath of those elements but the problem which I am currently facing is that this method is working correctly on the browsers like Chrome, Firefox, and Edge but not on the IE browser. The version of IE on my PC is 11.1593.14393.0. The IE browser is not able to find the element. I am also getting the following exception sometimes for other elements:
Exception in thread "main" org.openqa.selenium.InvalidSelectorException: Unable to locate an element with the xpath expression //img[contains(@src,'Insert XXX')] because of the following error: Error: Bad token: ]
I have tried the following methods for troubleshooting this issue but none of them worked out for me:
Enabling and disabling the enhanced protected mode for all the levels in IE browser.
Adding the URL of my webpage to the trusted capabilities.
Using the DesiredCapabilities method as suggested on the
AutomatedTesting page of the SmartGWT.
Setting a registry entry for IE browser in the PC.
Using the 32 bit IE driver instead of 64 bit.
Sadly, the IE browser is able to locate the elements on all the web pages except that belonging to my web application. Another problem which is troubling me is that none of the browser is able to locate the SMARTGWT element when I tried to find the element by ID. Also, the absolute XPath is working on every browser and that's why I went for the relative XPath method. What should I do to fix my issue? I want my code to run perfectly on all the browsers, but testing on this SmartGWT application has made my life hell.