The invention discloses a testing method and
system based on a message, which are used for a multiprotocol tested
system. Particularly, the method comprises the following steps of: obtaining a
test case and analyzing an interface name, parameter values of test parameters and a predicated result out of the
test case; determining an interface description file corresponding to the interface name and analyzing a protocol type and attribute information of the test parameters out of the interface description file; converting the parameter values according to the attribute information of the test parameters; splicing the converter parameter values to form a message; and calling a protocol communication processor corresponding to the protocol type to send the message to a tested
system. Different interface description files are defined and generated according to different message protocol types so that the test parameters in the
test case are converted into the parameter values meeting the protocols according the interface description files of the different protocol types, and the different protocol communication processors are called according to different protocol types to receive and send messages to the tested system; and therefore, the tested system with a plurality of protocols can be conveniently tested and a plurality of test tools do not need to be troublesomely replaced.