Results 1 to 2 of 2

Thread: Unable to find webelement in selenium chromedriver using xpath

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2021
    Posts
    5

    Unable to find webelement in selenium chromedriver using xpath

    I am trying to read messages of telegram from telegram web. I am using vb.net and Selenium chrome webdriver. I can successfully read the last message of any opened chat by the following lines


    Dim ie As IWebElement = drivert.FindElement(By.XPath("(//div[@class='im_message_text']) [last()]"))


    However, when I change the chat on the web manually, it is unable to find the element.


    If I once again go back to the first chat, it finds the element. So, basically after launching webdriver, it reads one chat and sticks to it. If I receive a new message in that chat, it read the new message. However, switching the chat makes it unable to find element. It is due to the changed URL whuile switching between the chats?

    PS : I am defining ie webelement every time I press the read button in my application.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: Unable to find webelement in selenium chromedriver using xpath

    Hello hardik2309,

    Is this of any use? https://core.telegram.org Also could you post a working example of what you are trying to do?

    yours,
    Peter Swinkels

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width