"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