I am trying to Post a status in FB using selenium. But i am not able to correctly locate the Edit status text and getting NoSuchElementException. I have tried different xpaths, which are correct too but still i am getting the same exception. Please help
For me, the checklist in a case when Selenium reports that an element is not found is:
- Is the correct page fully loaded in the browser window, driven by Selenium?
- Is the page in the expected state (e.g. user is logged in)?
- Does the XPath expression work on the particular page from a manual browser instance?
As a side note: to manually determine if an XPath expression is correct, it can be verified in the browser's console (opened with
On Facebook, I tested it like this:
In case the XPath is correct, it returns the found element.
To find the button for posting status, The following XPath worked for me:
Which was verified in browser, when I executed in console the following command: