Forum Discussion

shubham1's avatar
shubham1
Occasional Contributor
5 years ago

Region.find is always returning true

I have used Regions.Find to find an image(stored in Region) in an object.

But the code is passing even when the image is not present in the object

  • Object = Aliases.VizGui.wndViz.TkChild.TkChild.TkChild.PeakOCSWnd; is an image.

    ss= it is the region i have created.


    Below code will help you compare the ss regions to get compare with the Object

    Regions.Items(ss).Check(Object , false, false, 1, 1);

  • anupamchampati's avatar
    anupamchampati
    Frequent Contributor

    Object = Aliases.VizGui.wndViz.TkChild.TkChild.TkChild.PeakOCSWnd; is an image.

    ss= it is the region i have created.


    Below code will help you compare the ss regions to get compare with the Object

    Regions.Items(ss).Check(Object , false, false, 1, 1);

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Can you provide sample code that does not work?

     

  • shubham1's avatar
    shubham1
    Occasional Contributor

    This is the code snippet i am using for a POC purpose

     

    function Test()
    {


    let page = Aliases.VizGui.wndViz.TkChild.TkChild.TkChild.PeakOCSWnd;

    Regions.Find("abc",page)
    Regions.FindRegion("ss",page)


    }

  • sonya_m's avatar
    sonya_m
    SmartBear Alumni (Retired)

    Thank you, Community!🙂

     

    shubham1 could you give Anupam's suggestion a try to see if it works?