する方法を教えてください自動検査以外のJavaScriptアプリケーション?

StackOverflow https://stackoverflow.com/questions/211694

  •  03-07-2019
  •  | 
  •  

質問

皆様にお伝えしたくて書き込みを制御する事で素敵なJavaScriptないものとなっています。テストとセレンを動作します。ものすべての試験とブラウザのJavaScriptの機能を無効に(私のブラウザなラセレン.があるのではな自動テスト。

役に立ちましたか?

解決

WWW::機械化試験::WWW::機械化 二つのPerlモジュールだった。

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');

他のヒント

Seleniumはわかりませんが、NoScript Firefox拡張機能を使用すると、ドメインごとにスクリプトを無効にできます。それを使用して、Seleniumを許可し、ページのスクリプトを無効にできますか?

JavaScriptを使用しない単なるhtmlの場合、通常のスクリーンスクレイピング手法を使用して、サーバーからダウンロードしたhtmlを期待するものと比較できます。ブラウザーでテストする必要はありません。

Watirを使用してWebアプリケーションをテストできます。

http://wtr.rubyforge.org/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top