ChrisPro
11 years agoContributor
Test a password?
Hello, I test a password with following site : http://www.passwordmeter.com/ I would like to not use the site but a DLL library or others. Do you have a solution?
Hi,
What do you need this for?
Are you developing / testing a software that measures password complexity?
Great article to consider: http://www.soapui.org/testing-dojo/best-practices/methods-for-deciding-what-to-test.html
In general: TestComplete does not have this functionality, so you will have either to code it yourself or use some third-party component.
Do you know " third-party component"?
No, I don't. (Mostly, because this kind of check was always out of scope in our testing.)
ChrisPro wrote:Do you know " third-party component"?
Did you notice that the HTML source of the page you referenced in your first post is exposed in the Document Object Model? Why do I mention that? Because you could write code in TC or use a vbscript or javascript to automate the process so that it programaitcally inputs the password to run the check?
Option Explicit
Const CSTR_URL = "http://www.passwordmeter.com/"
Dim appIE : Set appIE = CreateObject("InternetExplorer.Application")
Dim pswd : pswd = "A_1!@#%c2"
Dim ieDoc, input, output
With appIE
.ToolBar = 1
.StatusBar = 1
.Visible = 1
.Navigate CSTR_URL
End With
' Important: wait till User can interact
While appIE.Busy appIE.readyState <> 4
WScript.Sleep 375
Wend
'<input type="text" id="passwordTxt" name="passwordTxt" autocomplete="off" onkeyup="chkPass(this.value);" class="hide" />
Set ieDoc = appIE.document
Set input = ieDoc.getElementById("passwordTxt")
input.Value = pswd
input.Click()
WScript.Sleep 775
Set output = ieDoc.getElementById("score")
'display the 'score'
WScript.Echo output.Value