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:48

I would also recommend Selenium. It got a really nice Firefox Plugin, that you can use to create your integration tests.

查看更多
再贱就再见
3楼-- · 2019-02-01 14:48

Another great tool for browser testing which is built as Ruby library and uses Ruby for scripting is Watir. There is also a firefox plugin for watir just like selenium called
Firewatir hosted on google code

查看更多
对你真心纯属浪费
4楼-- · 2019-02-01 14:49

If you need to do full testing including exploiting browser features like AJAX then I would recomend Selenium. Selenium launches a browser and controls it to run the tests.

It supports all the major platforms and browsers. Selenium itself is implemented in Java but that is not really an issue if it is being used to test a web application through its user interface.

Selenium tests are a sequence of commands in an HTML table, the supported commands are in well documented. There is also an IDE implemented as a Firefox plugin that can be used to record and run tests. However the test scripts created in the IDE can be used to drive tests against any of the supported browsers.

查看更多
够拽才男人
5楼-- · 2019-02-01 14:50

You can also control selenium using Selenium-RC's python binding. For example:

from selenium import selenium
selenium = selenium("localhost", 4444, "*firefox",
            "http://www.google.com/")
selenium.start()
selenium.open("/") # open google.com
selenium.type("q", "selenium rc")
selenium.click("btnG")
selenium.wait_for_page_to_load("30000")
selenium.failUnless(selenium.is_text_present("Results * for selenium rc"))
selenium.stop()
查看更多
倾城 Initia
6楼-- · 2019-02-01 14:53

Here's another option, all written in Python and cross browsers for running AND recording tests: Windmill

查看更多
太酷不给撩
7楼-- · 2019-02-01 14:56

TestPlan is a great tool for general purpose web testing. It provides both a display-less backend and Selenium. The Selenium backend should take care of testing in all the popular browsers. It also has its own scripting language which makes it quick to write and test, though Java can also be used.

For example, this goes to a page and submits a search form and checks that it found the correct result.

GotoURL http://myapp.com/

SubmitForm with
  %Params:search% some term
end

Check //div[@id='results'][contains(text(),'some term']
查看更多
登录 后发表回答