How do I detect text inside of this, this is HTML & this is XPath. I tried

HTML
    <span class="messageText">Hello.</span>
XPath
    //*[@id="liveAgentChatLogText"]/span[22]/span[2]

I tried with this but it didn’t work, it said no such element found.

driver.find_element(By.XPATH, '//*[@id="liveAgentChatLogText"]//*[contains(string(.), "Hello")]')



Source link https://sqa.stackexchange.com/questions/35498/---syntaxerror---while-

LEAVE A REPLY

Please enter your comment!
Please enter your name here