0

We have an internal asp.net web application which users can configure and execute automated tests. I'd like to be able to launch tests with is application but from a remote command line console or other non browser way. The goal is to be able to launch tests without user interaction. Any ideas how to do this without a high impact on the existing solution? Thanks in advance, John

7
  • 1
    A command line HTTP client like curl ? Commented Nov 3, 2014 at 14:35
  • Thanks for your reply Alex, I'm not familiar with curl. Could you use it to send commands that login to the web application and run a particular method with parameters? Commented Nov 3, 2014 at 14:50
  • It loads urls in the same way that a browser does, you just call one with appropriate post/get parameters & cookies Commented Nov 3, 2014 at 14:59
  • Interesting, do ou know of any good curl examples that interest with an asp.net application? I'll google for some myself. Commented Nov 3, 2014 at 15:26
  • I once used ikvm to compile HTML unit as a .net assembly. HTML unit is a headless browser (No UI is rendered to) that is used by Java devs to test web applications. I found it had pretty good support for automating page posts and finding element values from the response (you could query the results using XPath expressions and activate parts of the page, which was useful if your page uses javascript). I don't have a step-by-step since I did this years ago, but it is just one type of solution you could use. Commented Nov 3, 2014 at 15:49

1 Answer 1

1

The solution to my problem was Web API. I found a way to do exactly what I wanted by adding a few simple files to the asp.net application and then calling it using PowerShell's Invoke-RestMethod. Details of setting up the Web API: http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/using-web-api-with-aspnet-web-forms Details of using Invoke-RestMethod: http://csharpening.net/?p=1613 John

Sign up to request clarification or add additional context in comments.

1 Comment

Nice one. although the Invoke Restmethod link is broken, you point in the right direction. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.