log into wordpress with webinject
I am trying to create a script log into the admin section of wordpress and then check for updates, I already did this for drupal using the example mentioned here:
<case
id="1"
description1="short description"
description2="long description"
method="post"
url="http://myserver/test/login.jsp"
postbody="username=corey&password=welcome"
verifypositive="verify this string exists"
verifynegative="verify this string does not exist"
logrequest="yes"
logresponse="yes"
sleep="3"
/>
and also a comment here http://drupal.org/node/147413#comment-1269222
I am however stuck with the postbody part, it wont log in the admin page.
Any thoughts?
I can tell you about the testcases we created for atlassian suite, maybe the example will help you, this case is the one we created for CONFLUENCE
TESTDATA FILE
confluence_Basic_AD_Login_testdata.xml (it first login to webapp and then checks login by checking the dashboard)
<testcases repeat="1">
<case
id="1"
description="Get Confluence Login Page"
method="post"
url="https://confluence.company.com/login.action"
postbody="os_username=conflumin&os_password=conflumin123"
errormessage="Unable to connect to the login page of Confluence"
verifypositive="Username"
logrequest="yes"
logresponse="yes"
/>
<case
id="2"
description="Authentication by AD to Confluence"
url="https://confluence.company.com/dashboard.action"
verifypositive="Dashboard"
errormessage="Unable to authenticate user in Confluence"
logrequest="yes"
logresponse="yes"
/>
</testcases>
CONFIG FILE
file: confluence_Basic_AD_Login_config.xml
<testcasefile>confluence_Basic_AD_Login_testdata.xml</testcasefile>
<useragent>WebInject Application Tester</useragent>
<timeout>10</timeout>
<globaltimeout>30</globaltimeout>
<reporttype>nagios</reporttype>
That's all, and the check works with NagiosXI. Hope it helps you.
karina
精彩评论