tag:support.arachni-scanner.com,2012-07-01:/discussions/questions/13416-login_script-check-pattern-failingArachni: Discussion 2017-08-30T19:56:22Ztag:support.arachni-scanner.com,2012-07-01:Comment/432814082017-08-26T16:48:26Z2017-08-26T16:48:26ZLogin_Script check pattern failing<div><p>Are you sure your script is actually working? The JS will run in the browser like usual and this means that it'll work asynchronously and have all the drawbacks of that environment.</p>
<p>If you're not sure about what's going on you should switch to a Ruby script, that'll allow for greater control and for easier debugging.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/432814082017-08-29T15:08:48Z2017-08-30T19:53:19ZLogin_Script check pattern failing<div><p>Hi Tasos,</p>
<p>Thank you for the quick reply!<br>
I tried it with Ruby script, but in this case I get the attached error message. I don't know which element it can't find...<br>
Here is my rb scipt:</p>
<pre>
<code>browser.goto '<URL>/login?TargetUrl=/'
browser.text_field( :id => 'username' ).set('admin')
browser.text_field( :id => 'password' ).set('password')
browser.input( :id => 'loginButton' ).click
sleep(3)
framework.options.session.check_url = '<URL>/#/userMgmt'
framework.options.session.check_pattern = 'Home'</code>
</pre>
<p>I checked in chrome dev mode that all of the UI elements (username, password, loginButton) are present in the login page.</p>
<p>Thanks,<br>
Szilvi</p></div>Szilvia Molnártag:support.arachni-scanner.com,2012-07-01:Comment/432814082017-08-29T15:14:24Z2017-08-29T15:14:24ZLogin_Script check pattern failing<div><p>Ohh, BTW the browser.goto and the session.check_url is set properly in the script (browser.goto 'URL/login?TargetUrl=/') it just looks like that during the submission process of my answer somehow it disappeared from my answer...</p></div>Szilvia Molnártag:support.arachni-scanner.com,2012-07-01:Comment/432814082017-08-30T19:56:22Z2017-08-30T19:56:22ZLogin_Script check pattern failing<div><p>The error message says it all, is the element actually interactable and visible or do you need to trigger some other DOM event to bring it out?</p>
<p>Also, your <code>check_url</code> may not work, it won't be loaded in a browser, it'll be requested over HTTP, so the URL fragment won't matter.</p></div>Tasos Laskos