Speedfox
Speedfox

Reputation:

How can I do automated tests on non JavaScript applications?

I am writing controls that work nice with JavaScript, but they have to work even without it. Now testing with selenium works fine for me. But all test with disabled JavaScript (in my browser) won't run with selenium. Is there a way to do automated test for this purpose?

Upvotes: 4

Views: 538

Answers (5)

Željko Filipin
Željko Filipin

Reputation: 57262

You could use Watir to test your web application.

http://wtr.rubyforge.org/

Upvotes: 0

Schwern
Schwern

Reputation: 164639

WWW::Mechanize and Test::WWW::Mechanize are two Perl modules to do exactly that.

use Test::More tests => 5;
use Test::WWW::Mechanize;

my $mech = Test::WWW::Mechanize->new;

# Test you can get http://petdance.com
$mech->get_ok( "http://petdance.com" );

# Test the <BASE> tag
$mech->base_is( 'http://petdance.com/', 'Proper <BASE HREF>' );

# Test the <TITLE>
$mech->title_is( "Invoice Status", "Make sure we're on the invoice page" );

# Test the text of the page contains "Andy Lester"
$mech->content_contains( "Andy Lester", "My name somewhere" );

# Test that all links on the page succeed.
$mech->page_links_ok('Check all links');

Upvotes: 1

a2800276
a2800276

Reputation: 3328

If it's just plain html with no javascript, you could just use normal screenscraping techniques to compare the html you downloaded from the server to what you expect, no need to test in a browser.

Upvotes: 0

SmacL
SmacL

Reputation: 22922

Check out other automation packages such as TestComplete or AutoIt

Upvotes: 1

Matthew Wilson
Matthew Wilson

Reputation:

I don't know Selenium, but with the NoScript Firefox extension, you can disable scripts on a per-domain basis. So could you use that to allow Selenium but disable your page's scripts?

Upvotes: 2

Related Questions