Integration Testing for a Web App

2019-02-01 14:23发布

I want to do full integration testing for a web application. I want to test many things like AJAX, positioning and presence of certain phrases and HTML elements using several browsers. I'm seeking a tool to do such automated testing.

On the other hand; this is my first time using integration testing. Are there any specific recommendations when doing such testing? Any tutorial as well?

(As a note: My backend code is done using Perl, Python and Django.)

Thanks!

9条回答
等我变得足够好
2楼-- · 2019-02-01 14:59

In this article, Noah Gift does a good job presenting three main alternatives for web app integration testing: Windmill, Selenium and Twill. Twill doesn't do Javascript, so that leaves Selenium and Windmill as your main possibilities; Gifts shows enough about what using each of them means, so you can choose.

One thing Gift doesn't mention is that Selenium is much more popular -- that's not obvious if you just web search each of the terms windmill and selenium, but that's because each gets (different numbers of;-) false hits. [windmill javascript] gives 325k hits, [selenium javascript] gives 1.2M hits, and this ratio is more representative. Anyway, the point is that, if you find them both equally easy and powerful enough for your needs, so that you have a hard time choosing one, then picking selenium (i.e., going with the crowd) may have advantages (more experts around, e.g. on SO to answer questions;-) wrt picking the somewhat less popular alternative.

查看更多
霸刀☆藐视天下
3楼-- · 2019-02-01 15:02

Selenium is a good way to go. For using it with Perl then use the Test::WWW::Selenium CPAN module.

Here is one example from its pod:

use WWW::Selenium;

my $sel = WWW::Selenium->new( host => "localhost", 
                              port => 4444, 
                              browser => "*iexplore", 
                              browser_url => "http://www.google.com",
                            );

$sel->start;
$sel->open("http://www.google.com");
$sel->type("q", "hello world");
$sel->click("btnG");
$sel->wait_for_page_to_load(5000);
print $sel->get_title;
$sel->stop;

And here are some additional links which maybe helpful:

/I3az/

查看更多
Evening l夕情丶
4楼-- · 2019-02-01 15:05

Selenium is a very good tool to automate browser testing

Since you mentioned Ruby in your tags, I also recommend Webrat which is a nice in-browser testing solution in Ruby.

查看更多
登录 后发表回答