Scan redirects to error page

naveen.085's Avatar

naveen.085

07 Feb, 2017 04:18 PM

Hi Tasos Laskos,

Thank you for your valuable suggestions and I am more interested when I work with arachni and understating it better .

But I am getting always some unique challenges.

I have a stand alone ruby script not arachni is running successfully without issue( going to sucessful page). But when I run this same script as an arachni plugin, I see, It is redirecting to my application error page and not able to trace why its happening..

''#!/usr/bin/env ruby
require 'browser'
require 'watir'


Selenium::WebDriver::Firefox::Binary.path='C:/Naveen/softwares/ff/49/firefox.exe'
 
profile = Selenium::WebDriver::Firefox::Profile.new

browser =Watir::Browser.new :firefox

#=begin  
url='https://mysite.com/home'
ssn='550-72-2440'
puts url
puts 'On Landing Page'
browser.goto(url)
browser.screenshot.save("landingPage.png")
browser.button(:id => 'buttonId').click
sleep 10
browser.screenshot.save("applicationPage.png")
form = browser.form(id: 'applicationForm')
puts 'Filling application page'
form.text_field(id: 'fname').set "Tom"
form.text_field(id: 'lname').set "Lewis"
form.text_field(id: 'address').set "xxx usa"
form.text_field(id: 'cityField').set "vermont"
browser.select_list(:id => 'stateField').option(:value => 'NH').select
form.text_field(id: 'zipCode1Field').set "94455"
form.text_field(id: 'salary').set "125000"
form.text_field(id: 'dob').set "01-01-1975"
puts browser.url
form.text_field(id: 'ssn').set ssn
puts 'application filled'
browser.screenshot.save("applicationFilled.png")
puts 'submitting the form'
browser.element(:css => 'input[type=submit][name=next]').click
puts 'taking screenshot'
browser.screenshot.save("clicking.png")
sleep 10
browser.screenshot.save("decisionPage.png")
#=end
  1. Support Staff 1 Posted by Tasos Laskos on 07 Feb, 2017 04:21 PM

    Tasos Laskos's Avatar

    Does the script work when using PhantomJS 2.1.1 like Arachni?

  2. 2 Posted by naveen.085 on 07 Feb, 2017 04:35 PM

    naveen.085's Avatar

    Do you mean, want me to use Phantom js instead of firefox

  3. Support Staff 3 Posted by Tasos Laskos on 07 Feb, 2017 04:36 PM

    Tasos Laskos's Avatar

    Yep

  4. 4 Posted by naveen.085 on 07 Feb, 2017 05:25 PM

    naveen.085's Avatar

    Hi Tasos,
    I've used phatom js and it is working as expected...and i am able to take screenshot and it is good.


    require 'watir'
    require 'phantomjs'
    require 'browser'
    Phantomjs.path #C:\Naveen\softwares\phantomjs-2.1.1\bin
    Selenium::WebDriver.for :remote, url: 'http://localhost:8001'

    browser =Watir::Browser.new :phantomjs

    #=begin
    url='https://mysite.com/home'
    ssn='550-72-2440'
    puts url
    puts 'On Landing Page'
    browser.goto(url)
    browser.screenshot.save("landingPage.png")
    browser.button(:id => 'buttonId').click
    sleep 10
    browser.screenshot.save("applicationPage.png")
    form = browser.form(id: 'applicationForm')
    puts 'Filling application page'
    form.text_field(id: 'fname').set "Tom"
    form.text_field(id: 'lname').set "Lewis"
    form.text_field(id: 'address').set "xxx usa"
    form.text_field(id: 'cityField').set "vermont"
    browser.select_list(:id => 'stateField').option(:value => 'NH').select
    form.text_field(id: 'zipCode1Field').set "94455"
    form.text_field(id: 'salary').set "125000"
    form.text_field(id: 'dob').set "01-01-1975"
    puts browser.url
    form.text_field(id: 'ssn').set ssn
    puts 'application filled'
    browser.screenshot.save("applicationFilled.png")
    puts 'submitting the form'
    browser.element(:css => 'input[type=submit][name=next]').click
    puts 'taking screenshot'
    browser.screenshot.save("clicking.png")
    sleep 10
    browser.screenshot.save("decisionPage.png")
    #=end


  5. Support Staff 5 Posted by Tasos Laskos on 07 Feb, 2017 08:17 PM

    Tasos Laskos's Avatar

    Fair enough then, however I'll need access to the webapp in order to debug this.
    Any chance you can set that up?

  6. 6 Posted by naveen.085 on 07 Feb, 2017 09:47 PM

    naveen.085's Avatar

    I am sorry . Due to my limitations, I can not share..

  7. Support Staff 7 Posted by Tasos Laskos on 08 Feb, 2017 03:57 PM

    Tasos Laskos's Avatar

    I pushed a new nightly yesterday that solved a similar problem, you may have some luck with it.
    If the problem is still there then I'm afraid I can't do much without access to the webapp.

  8. Tasos Laskos closed this discussion on 25 Mar, 2017 02:17 PM.

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