How to test with selenium the creation of posts of wordpress and what happens in the frontend?
I was able to replicate this, and found the problem to be the address of the site. I was opening http://www.example.com/ and it was being redirected to http://example.com
Check that your base URL (http://localhost/wordpress/) is not being changed when the logon page is loaded.
The clue for me was the URL in the address bar when the logon page was displayed for the second time:
http://example.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fwww.example.com%2Fblog%2Fwp-admin%2F