Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to terminate arachni scan if Login script fails #1005

Open
TiredOfProgramming opened this issue Aug 9, 2018 · 0 comments
Open

How to terminate arachni scan if Login script fails #1005

TiredOfProgramming opened this issue Aug 9, 2018 · 0 comments

Comments

@TiredOfProgramming
Copy link

TiredOfProgramming commented Aug 9, 2018

Hello,

In Ruby one can terminate batch job by simply calling exit function

https://stackoverflow.com/questions/30337972/how-to-tell-a-ruby-program-to-close-itself

The part of my arachni Login script looks like below (different variations):

begin
browser.image(:id => 'someIdHere').wait_until_present(60)
puts 'User successfully lands on MyWebSite home page with the URL ' + browser.url
rescue
puts 'Unable to reach MyWebSite home page'
exit
end
begin
browser.image(:id => 'someIdHere').wait_until_present(60)
puts 'User successfully lands on MyWebSite home page with the URL ' + browser.url
rescue
puts 'Unable to reach MyWebSite home page'
abort('Aborting the scan as it login script fails')
end

However, when rescue part of the script starts executing, arachni scan never finishes and keeps crawling (probably just home page).

The reason I raised this question is my arachni scan is set up in VSTS. I would like to mark arachni batch job as failed if something gone wrong in the Login script. But, with aforementioned problem, arachni keeps scanning and produces no report at the end, where VSTS thinks that batch task was successful.

Please advise if you have a proper solution on stopping (erroring out) entire arachni batch job from the Login script...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant