2

Is it possible to change an Insight image during the execution of a test?

That way, I can have a single object in my object repository, for example "AbstractInsightObj"

I am looking to do something like what I have described below.

Pseudocode:

AbstractInsightObj.Click  'Clicks object A
AbstractInsightObj.ChangeImage("C:/pictureOfImageB.jpg")
AbstractInsightObj.Click  'Clicks object B

I am aware I can create two separate Insight Objects in the repository, but for my use case, it would be simpler if I could just reuse one repository object.

Does anyone have any insight? (No pun intended.)

1 Answer 1

2

Insight objects can contain the image either internally (when created during record or learn) or by supplying an image (this is probably what you're looking for).

When supplying an image you need to put in in the test object's ImgSrc property, this can done either by using descriptive programming thus:

InsightObject("ImgSrc:=C:\pictureOfImageA.jpg").Click
InsightObject("ImgSrc:=C:\pictureOfImageB.jpg").Click

Or by using SetTOProperty.

AbstractInsightObj.Click
AbstractInsightObj.SetTOProperty "ImgSrc", "C:\pictureOfImageB.jpg"
AbstractInsightObj.Click
3
  • thank you greatly, I wasn't aware of the ImgSrc property. Commented Dec 10, 2013 at 20:15
  • This solution is not working in UFT 12.54
    – Ritwik
    Commented Dec 13, 2018 at 14:05
  • @Ritwik what isn't working?
    – Motti
    Commented Dec 13, 2018 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.