用CheckProperty方法,给你个例子。If JavaWindow("QTP1").JavaEdit("QTP2").CheckProperty("value","XXX",10) then a=2Else b=2End If如果文本框值是XXX,a=2不是XXX,b=2