"Wrong number of arguments" error when trying to click on JavaStaticText object in QTP

StackOverflow https://stackoverflow.com/questions/19272457

  •  30-06-2022
  •  | 
  •  

문제

I am facing an issue clicking on a JavaStaticText object in QTP while testing a Java application. I have added the objects to my object repository and named the JavaStaticText object "DEPLOY":

Here is my script :

Set Main = JavaWindow("MainScreen")
If Main.Exist Then
    Main.JavaButton("d").Click
Else
    print "Console is not present"
End If
Main.JavaStaticText("DEPLOY").Click

The script is throwing the following error at the last statement:

Wrong Number of Arguments or Invalid Property Assignment

I am out of ideas as to why this error is thrown!

Thanks in advance

도움이 되었습니까?

해결책

According to the UFT help, clicking on JavaStaticText requires that you supply X and Y coordinates. Assuming all your identifiers are correct, you can try something like:

Main.JavaStaticText("DEPLOY").Click 1, 1

... or 0, 0, or whatever you find appropriate and reliable for the given object.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top