Closed ricardoperovano closed 6 years ago
Interesting I'll need to make modular element lookups so it's easier to change
you can get the number of unread messages at XPath //*[@id="pane-side"]/div/div/div/div[2]/div/div/div[2]/div[2]/div[2]/span[1]/div[2]/span
@marcelocecin I could not got it working. I tried
IReadOnlyCollection<IWebElement> unread = driver.FindElements(By.XPath("//*[@id=\"pane-side\"]/div/div/div/div[2]/div/div/div[2]/div[2]/div[2]/span[1]/div[2]/span"));
but it just ignore the unread messages. I also tried to work around with theses divs and spans, but no success
//*[@id="pane-side"]/div/div/div/div[1]/div/div/div[2]/div[2]/div[2]/span[1]/div
Use this it's working
@whatsappbot It worked, thankyou. I need to discover all the others paths and change it. Do you use some kind of extension on chrome to get the xpath from an easier way ?
@ricardoperovano there is, selenium IDE plugin, although I don't know what the compatibility is
@IwraStudios thankyou, I'm going to try it.
@ricardoperovano eu pego no Safari, se precisar de mais algum caminho é só falar
@marcelocecin obrigado, agora estou conseguindo avançar.
This is what I did until now.
Xpath to get unread messages:
/html[1]/body[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/*/div/div/div[@class="_2EXPL CxUIE"]
Xpath to get Read Messages:
/html[1]/body[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/*/div/div/div[@class="_2EXPL"]
Xpath to get the title when you loop through the messages (use it on unread webelement)
/html[1]/body[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/*/div/div/div[@class="_2EXPL CxUIE"]/div/div/div[@class="_25Ooe"]
I'm trying to get rid of the class name, but i did not figure it out how to do it, for now I need to put the class name.
what about sending messages
@adeministr what you mean ?
@ricardoperovano can't send messages. how can i send?
@adeministr you'll need to get the text box element path and update the source
I haven't had the time to refactor element lookups yet
@IwraStudios , I've made the new element lookups, how can I contribute to your project ?
@ricardoperovano Thanks for the contribution
@IwraStudios no problem!
All the classes like 'unread', 'active' has gone, now its difficult to navigate through the elements and find unread messages!