P0-tensor and P-tensor are introduced in tensor complementarity problem, which have wide applications in many fields such as game theory, tensor complementarity problem. The problem of testing whether a given tensor is a P(P0)-tensor is NP-hardness. In this talk, SDP-relaxation methods are established for detecting P(P0)-tensor. To this end, detecting problems are reformulated as polynomial optimization problems. Based on these reformulation, SDP relaxation algorithms are proposed to check P-tensor and P0-tensor, respectively. Numerical examples are reported to show the efficiency of the proposed algorithms.