How to test the creation of Wordpress messages with selenium and what happens in the interface?
I am using Selenium RC and I have a test case that creates messages and checks the frontend (public side) if messages were generated and how they are displayed.
But even if I log in at the beginning of the test case, when I call the open command to navigate to wp-admin, I am sent to the registration page.
Why openly ignore that I have already been authenticated?
My goal is to create a test case with a test case at the start and a test case for logging out.
Here is my broken test case:
<tr>
<td>open</td>
<td>wp-admin/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>user_login</td>
<td>admin</td>
</tr>
<tr>
<td>type</td>
<td>user_pass</td>
<td>pass</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>wp-submit</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>wp-admin</td>
<td></td>
</tr>
<tr>
<td>break</td>
<td></td>
<td></td>
</tr>
// ---> Login page instead of Dashboard
And it works with Selenium IDE.
java -jar "selenium-server.jar" -avoidProxy -userExtensions "user-extensions.js"
-trustAllSSLCertificates -proxyInjectionMode -log "log.log"
-Dhttp.proxyHost=proxy -Dhttp.proxyPort=80
-htmlSuite "*firefox" "http://localhost/wordpress/" "testSuite.html" "results.html"
thank
source to share
I was able to reproduce this and found the problem by the address. I opened http://www.example.com/ and redirected to http://example.com
Make sure your base url ( http: // localhost / wordpress / ) doesn't change when the login page loads.
The key for me was the url in the address bar when the second login page was displayed:
Http: // example.com /blog/wp-login.php?redirect_to=http%3A%2F%2F www.example.com % 2Fblog% 2Fwp admin% 2F
source to share