The invention discloses a cloud testing framework oriented to protocol conformance of a heterogeneous wireless sensor network. The cloud testing framework comprises a cloud testing platform, testing agents and a system under test, wherein the cloud testing platform is responsible for control and management of testing execution and testing process; the testing agents are a communication bridge between the system under test and the cloud testing platform, after receiving a command of the cloud testing platform, the corresponding testing agent forwards the command to a device in a network of the corresponding system under test, and further allocates a role for the testing device to form a corresponding testing network; wherein the cloud testing platform mainly comprises an IaaS (Infrastructure as a Service), a PaaS (platform as a service) and a SaaS (Software as a Service); a testing user accesses the cloud testing platform via the Internet through a Web interface provided by the SaaS, after the testing user submits testing requirements and related testing configurations, the testing platform allocates testing resources according to the testing requirements, related virtual servers perform test, moreover, the testing process is monitored through the SaaS, and finally, a complete test report is obtained.