Forum Discussion

sujatha_babu's avatar
sujatha_babu
Contributor
11 years ago

Image comparsion

Hi,



I am using Test Complete 9.30.


I am using script view for my testing purpose, when I create the region checkpoints using the Select Window region (by mouse drag) it generates the following code. When I use this code in my script, am unable to do the image comparison. Getting an error as "Cannot get a picture object from the input parameter"



// generated code:



function Test2()

{

  Regions["IR17430"]["Check"](Regions["CreateRegionInfo"](Sys["Process"]("17430")["WPFObject"]("HwndSource: window1")["WPFObject"]("window1"), 39, 105, 956, 584, false));

  LLCollection1["LLP1_17430"]["Execute"](Sys["Process"]("17430")["WPFObject"]("HwndSource: window1")["WPFObject"]("window1"));

}



// my script:



LLCollection1["LLP1_17430"]["Execute"](Sys["Process"]("17430")["WPFObject"]("HwndSource: window1")["WPFObject"]("window1")["WPFObject"]("Chart1")["WPFObject"]("Area1"));

    BuiltIn["Delay"](1500);

    var ImgPros =(Sys["Process"]("17430")["WPFObject"]("HwndSource: window1")["WPFObject"]("window1")["WPFObject"]("Chart1")["WPFObject"]("Area1"));           

    AddImage(ImgPros,"IR17430")

    if(!Regions["Compare"](ImgPros,"IR17430", false, false, true, 0))

      Failure ("DI_17430_0_WPF_Chart_Chart", ImgPros, DefectInfo)