This paper presents an agent-based software environment for testing web-based applications. The infrastructure of the system consists of a lightweight agent platform that supports agent communication, an ontology of software testing that enables flexible integration of multiple agents, and a formalism using XML to represent both the basic and compound concepts of the ontology. Relations between testing concepts are defined and their properties are analysed. A number of agents are implemented to perform various tasks in testing web-based applications. Broker agents use the ontology as a means of inferences to manage the knowledge about agents and assign each task to the most appropriate agent.