0

I assigned an object to variable "abc" in function.vbs script

I have a test named "Action1" where I have a function named xyz().
function.vbs is associated with test "Action1".

Running the test throws an error "object doesn't support this property or method"

If I use single extension, it works fine
abc.JavaMenu("title:=file").select


If I use more than one extension to object throw an error "object doesn't support this property or method"
abc.JavaMenu("title:=file").JavaMenu("title:=view").select

Set abc = JavaWindow("title:=test")
Function xyz()
  abc.JavaMenu("title:=file").JavaMenu("title:=view").select
End Function
  • Have you checked that it works with `JavaWindow("title:=test").JavaMenu("title:=file").JavaMenu("title:=view").select` before you assume the problem is with the object assignation? – Dave May 21 '19 at 09:03
  • Note:- Function xyz() exists in separate file function.vbs which I load during the test run. Yes. I checked. It works if I use the complete path in function.vbs and also it works if I have the function inside the test. – Ravi shankar May 22 '19 at 11:07
  • Have you tried passing `abc` into the function by reference? i.e. `Function xyz(ByRef abc)` to start the function and ensure that the object is accessible to the function? – Dave May 22 '19 at 16:49

0 Answers0