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 and then click on them is by using 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:
I have tried the following methods for troubleshooting this issue but none of them worked out for me:
Code:
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: ]
- 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 JavaScriptExecutor to click on the elements.
Comment