Login script is timing out

stephen's Avatar

stephen

29 Aug, 2016 03:00 PM

My login script times out after 30 seconds, waiting for a certain form id, which does in fact exist. I am using the nightly build per Tasos' suggestion.

Here is the first error in the stack trace. I can send a more detailed stack trace if necessary.

[~] Login script: Running the script.
 [-] [utilities#exception_jail:428] Session: [Watir::Wait::TimeoutError] timed out after 30 seconds, waiting for {:id=>"login-form", :tag_name=>"form"} to become present

I have attached a screenshot of the HTML showing that the form id does indeed match what I have in my login script.

Here is my login script ( I have replaced the actual ip address with for the purpose of this support ticket):

browser.goto 'http://<ip_address>:8080/application/#login'

browser.form(:id => 'login-form').wait_until_present(30)
browser.text_field(:id => 'txtLogin').set 'test1'
browser.text_field(:id => 'txtPassword').set 'password'
browser.button(:id => 'btnLogin').click

browser.form(id: 'login-form').wait_while_present
Watir::Wait.until { browser.element(:id => "document-info-message").visible? }

Any help would be greatly appreciated.

  1. 1 Posted by stephen on 29 Aug, 2016 06:37 PM

    stephen's Avatar

    If any more info is needed, let me know.

  2. Support Staff 2 Posted by Tasos Laskos on 30 Aug, 2016 09:08 AM

    Tasos Laskos's Avatar

    Hello,

    You can try taking screenshots at different stages during the script:

    browser.screenshot.save ("screenshot.png")
    

    You can also inspect the code with:

    puts browser.html
    
  3. 3 Posted by stephen on 30 Aug, 2016 06:20 PM

    stephen's Avatar

    Hmm, I think I kind of understand the problem. The code that I see when I add puts browser.html in my script is as if I viewed the source of the page which doesn't have much in it. But in developer tools on chrome, that's where I can see all the individual elements, such as the form, etc. So when the page loads phantomjs/arachni views the page as blank and not containing those elements, which is why the timeout occurs.

    It is the script that loads all of the elements:
      <script data-main='packages/framework-runtime/framework-runtime.min' src='packages/requirejs/require.js'></script>

    I have attached the page source file. Is there a way to tell arachni/phantomjs to wait for that script to run?

  4. Support Staff 4 Posted by Tasos Laskos on 01 Sep, 2016 03:37 PM

    Tasos Laskos's Avatar
  5. 5 Posted by stephen on 08 Sep, 2016 03:38 PM

    stephen's Avatar

    Tasos,

    I've had some luck with phantomjs but still having issues with arachni even with pulling the nightly build.

    I've attached the script I used. In this script "loginView" is a div (contains the login-form). I've also attached the page.png file showing that the screenshot indeed contains something and is not blank. However, not sure how to get arachni to work like this. Trying to use the browser cluster wait for element results in a timeout, and when I take a screenshot of the page it's blank.

  6. 6 Posted by stephen on 16 Sep, 2016 01:41 PM

    stephen's Avatar

    Tasos, have you had a chance to look at this?

  7. Support Staff 7 Posted by Tasos Laskos on 16 Sep, 2016 01:44 PM

    Tasos Laskos's Avatar

    I'm afraid I'll need access to the webapp in order to debug this.
    You can send me the details in private if you prefer: tasos[dot]laskos[at]arachni-scanner.com

  8. Support Staff 8 Posted by Tasos Laskos on 05 Oct, 2016 09:23 AM

    Tasos Laskos's Avatar

    I checked it out and I'm afraid that there's nothing I can do.

    I tried the login script with just Watir and PhantomJS 2.1.1, without involving Arachni, and the error was still there.
    It looks like PhantomJS doesn't support your webapp, which means Arachni can't support it either.

    Sorry Stephen.

  9. Tasos Laskos closed this discussion on 24 Oct, 2016 09:00 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac