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.
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.