LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 09-01-2005, 03:10 PM   #1
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Is there a browser command line tool for testing javascript websites?


Currently we are using Nagios to do systems monitoring. One of the monitor scripts we have uses the Lynx text browser to do a dump of a web site. We check the output of the dump to verify the web site is up and running properly. We don't actually wish to view the site - we are just doing this so that we can alert if it doesn't give expected results.

Recently we've had an issue a couple of times with a site not being monitored so wanted to add monitoring for it. Unfortunately this site uses Javascript and Lynx being a text only browser won't work on it. In researching this I did find a Lynx replacement called Links but couldn't find any info on whether it allows doing a command line dump like Lynx does. My fear is that it actually requires one to open a browser window which as noted we don't need or want.

Additionally what I really need to test is whether the login at the web site is working. That is to say I not only want to access the site but also do an automatic login with password to verify that works. It is the login that failed in the recent incidents.

I've done some searching for this but didn't really find anything.

Does anyone know if Links or any other open source browser allows for doing such command line dump and/or automatic login?
 
Old 09-02-2005, 07:41 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,691

Rep: Reputation: 286Reputation: 286Reputation: 286
You can find Links here .
 
Old 09-04-2005, 10:12 AM   #3
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Original Poster
Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Thanks but one might suppose that the fact that I mentioned I had discovered "Links" would indicate I knew how to browse the internet. Or perhaps my comment that "I've searched but haven't found anything". My question was not where to find Links.

It was very specific about a need to access Javascript. While I suppose I could download it an try it my question was to see if anyone knew whether it worked for my sepcific need. For things like wget and curl there are specific FAQs that say they don't. If it doesn't work for this need then there is no point downloading it.

Of course one might say "RTFM" but since it only one of dozens of browsers that might or might not do what I want it seemed it was a perfect candidate for this list.

Sorry for the tone but it does annoy me when people don't actually read the detail that the FAQ here clearly indicates one should provide.
 
Old 09-04-2005, 12:12 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,165
Blog Entries: 4

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
http://www2u.biglobe.ne.jp/~hsaka/w3m/ is a link to a site which has an experimental extension for the text browser - W3M. None of the text browsers seem to want to even know about javascript natively.
 
Old 09-05-2005, 03:49 PM   #5
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Original Poster
Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote from the Sourceforge link for WM3:

w3m is a pager and/or text-based browser. It can handle table, cookies, authentication, and almost everything except JavaScript.
 
Old 09-05-2005, 04:51 PM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,165
Blog Entries: 4

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
Quote from the page I linked to:

EXPERIMENTAL JavaScript support of w3m (w3m-js)
This is the EXPERIMENTAL patch for w3m to support JavaScript using NJS JavaScript Interpreter.
 
Old 09-05-2005, 04:55 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
If you want to test the login then you should be able to just send a get or post request with the username and password data, this won't test the javascript but it will test the server. Since the javascript is unlikely to change and pose a problem I guess it should be enough for you.
 
Old 09-06-2005, 09:46 AM   #8
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Original Poster
Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Xavier:
Thanks I'll have a look at it.

David:
The user/password login screen is created by the Javascript so far as I can tell. When I view the source for the page there is no html code for these boxes. Using curl I was able to get the same page info but unable to login. My assumption is that it is ignoring the post data because it (the page) isn't requesting it but rather the javascript is waiting for it.

I'll admit I don't know much about web stuff so maybe I'm misunderstanding something. However all the suggestions I've found in my googling etc... don't seem to help. As a matter of fact most of the threads I've found show what people were trying to do to solve similar problems but never show an actual resolution.

Specifically I'm attempting to actually do the login because it is this login that lets the users know the application isn't working. The usual reason is because the DB on aother host was restarted AFTER the JBOSS on the host that has the web page. The fix is simply to stop/start JBOSS so it reconnects to the DB. The monitor I'm trying to write is one that would let me attempt the login. If it fails I would notify the folks who own JBOSS app (web page) to do their stop/start. Without this monitor the first indication we have of a problem is when the CIO himself attempts to use the app.

I'm working on another monitor instead that will simply let me know if JBOSS has started BEFORE the DB and alert but would really like to be able to test the login itself.

If there is a way of passing POST data to the Javascript using the exsiting tools please let me know. As noted above none of the methods I've seen tried in various threads actually seem to work when I try them.
 
Old 09-06-2005, 09:53 AM   #9
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
This heavily advanced "links" version does know about javascript:
http://links.twibright.com/
(and can dump a web page)

Yves.
 
Old 09-06-2005, 12:22 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
It shouldn't really matter how the form is made up. If it is using the http protocol then it will either send a GET or more likely a POST request to the server. You can then use lynx to make an identical request.

If you run ethereal and try to login you'll be able to see what type of request and in what format it is sent.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP command line tool cold Fedora 1 11-09-2005 10:14 AM
can i run a javascript from the command line ? nephish Linux - Software 2 11-08-2005 07:04 AM
Is there a command line tool to create images? J_Szucs Linux - Software 5 11-11-2004 02:51 AM
javascript from the command-line gmartin Programming 1 09-08-2004 10:54 AM
testing the modem from the command line? Pcghost Linux - Hardware 2 03-26-2003 02:38 PM


All times are GMT -5. The time now is 10:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration