LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Script to test localhost server (http://www.linuxquestions.org/questions/linux-general-1/script-to-test-localhost-server-915179/)

abbotslad 11-23-2011 04:21 PM

Script to test localhost server
 
Hi there

I've just written a webserver in C and wondered if there was a way of getting a script to test it.

I want it to:
open firefox at localhost:2001
wait 1 second
then EITHER refresh firefox
OR restart firefox localhost:2001

I'm not bothered about actually viewing the page as I have print statements in the C file to check that everything is working. Can you help?

I'm not sure how to capture the PID and to kill or restart it. Thanks.

corp769 11-23-2011 04:31 PM

You don't even need to go that far with opening firefox... You can use curl, and grep known text on your webpage, and test it that way. Sounds more feasible to me...No?

abbotslad 11-23-2011 04:50 PM

Thank you
 
I'll look into that, thanks.


All times are GMT -5. The time now is 05:59 AM.