0

I am running my tests in all the browsers and facing an issue while working with Edge browser. I have a code to find an element on page like below

WebElement element = driver.findElement(By.xpath("//div[contains(@title,'UserName')]"));

Above code is working fine in all the browsers and finding element correctly except Microsoft Edge browser.

I am using Windows 10 with Edge driver 18. I have downloaded exe as mentioned here.

Can anyone help me on this one?

Thanks, Chandresh Parmar

  • Microsoft WebDriver for Microsoft Edge (EdgeHTML) versions 18 and 19 is a Windows Feature on Demand which ensures that it’s always up to date automatically and enables some new ways to get Microsoft WebDriver. Ref: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ I suggest you to install the supported version of Edge web driver and make a test again. Let us know about your testing results. – Deepak-MSFT Nov 18 '19 at 13:53
  • Hi @Deepak-MSFT, I have already installed latest Microsoft WebDriver through above mentioned link and then after only I am getting this. In Microsoft WebDriver for Edge 17 version it was working fine. – Chandresh Parmar Nov 18 '19 at 17:44
  • Not sure, how did you download the Edge driver 18. As I informed you before. web driver can be downloaded till version 17 and for the version 18 and above, you need to enable the developer mode and run this command in command prompt [DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0] (No any .exe is available for download). I suggest you to check the version of your edge driver. It still looks like you had downloaded the incorrect version of edge driver. – Deepak-MSFT Nov 19 '19 at 08:10
  • Hi @Deepak-MSFT, Yes I have downloaded edge driver exe from the command you mentioned only. Same command is available on Microsoft WebDriver (https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) page. Microsoft EdgeHTML 18.17763 is the version I have on my windows. – Chandresh Parmar Nov 19 '19 at 10:47
  • Also, it is giving error only when for Xpath locators. If I use id/name then it works fine. See below command, this works fine. WebElement element = driver.findElement(By.id("UserName")); – Chandresh Parmar Nov 19 '19 at 10:55

0 Answers0