using Selenium webdriver to find elements with  

前端 未结 3 1912
遥遥无期
遥遥无期 2021-01-16 22:50

Hope you\'re all well. I\'m quite new to selenium and a complete newbie to stack overflowso i hope i\'m not disobeying any rules here.

I am trying to create a test f

3条回答
  •  抹茶落季
    2021-01-16 23:22

    Try to escape html characters by using System.Web.HttpUtility.HtmlDecode

    it works for me:

    var escaped = System.Web.HttpUtility.HtmlDecode(".//span[text()='Alumina MB China metallurgical grade delivered duty paid RBM/tonne']");
    IWebElement element = driver.FindElement(By.XPath(escaped));
    

提交回复
热议问题