googleid_118035
11 years agoContributor
Issue with getting an image of the selected object
Hi All,
I am try to get a calender popup window image through an JScripts.
Following are my approachs, but first approach only works?
function First_Approach()
{
var FilePath = "C:\\Dev_Chaminda\\Q2Soft\\TC003.jpg"
var myobject1 = Sys.Browser("iexplore").Page("http://localhost/Test/frmMyPage.aspx").Panel(0).Panel("cphMainContent_txtDOB_calendar_wrapper").Table("cphMainContent_txtDOB_calendar").Cell(1, 0).Picture();
myobject1.SaveToFile(FilePath);
}
function Second_Approach(){
var FilePath = "C:\\Dev_Chaminda\\Q2Soft\\TC003.jpg"
objectprop1 = new Array("ObjectIdentifier","ObjectType","Name","className");
objectvalue1 = new Array("1","Cell","Cell(1, 0)","rcMain");
var my_object1 = Sys.Browser("iexplore").Page("*").Find(objectprop1,objectvalue1, 2000, true).Picture();
my_object1.SaveToFile(FilePath);
}
I am try to get a calender popup window image through an JScripts.
Following are my approachs, but first approach only works?
function First_Approach()
{
var FilePath = "C:\\Dev_Chaminda\\Q2Soft\\TC003.jpg"
var myobject1 = Sys.Browser("iexplore").Page("http://localhost/Test/frmMyPage.aspx").Panel(0).Panel("cphMainContent_txtDOB_calendar_wrapper").Table("cphMainContent_txtDOB_calendar").Cell(1, 0).Picture();
myobject1.SaveToFile(FilePath);
}
function Second_Approach(){
var FilePath = "C:\\Dev_Chaminda\\Q2Soft\\TC003.jpg"
objectprop1 = new Array("ObjectIdentifier","ObjectType","Name","className");
objectvalue1 = new Array("1","Cell","Cell(1, 0)","rcMain");
var my_object1 = Sys.Browser("iexplore").Page("*").Find(objectprop1,objectvalue1, 2000, true).Picture();
my_object1.SaveToFile(FilePath);
}
- Hi Dev,
The Picture method doesn't seem to work as expected. I failed to reproduce this behavior on TestComplete 10.30. Most probably, it is reproduced only on TestComplete 10.0 that you are using. Can you upgrade to the latest product version?