Forum Discussion
hi
When i am doing this manually it is working properly without any problem.
Excel is getting crashed only when i am using test complete.
In below code i am clicking on different tabs for switching using a loop :
for(var i = 0; i < 4; i++)
{
Sys.Process("iexplore").Page("*").Panel(2).Panel(0).Panel("docEmbed").Panel("packageTabs").Panel("tabObjectName_" + i).Click();
Delay(5000);
if(i == 0)
{
fn_Element_Instance(counter);
counter++;
}
else if(i == 3)
{ Delay(5000);
fn_Element_Instance_Excel(counter);
counter++;
}
else
{
for(var j = 0; j < 2; j++)
{
fn_Element_Instance(counter);
counter++;
}
}
}
thanks
- tristaanogre7 years agoEsteemed Contributor
What's in fn_Element_Instance_Excel? It seems that would be where the problem would be since that is the only code that would explictly be doing anything with Excel.
- hkaur7 years agoOccasional Contributor
There are certain other sub functions which are getting called inside this method.
But i think problem is occurring when i am trying to click on tabObjectName in the previous code only.
But you can refer the below code if it helps
function fn_Element_Instance_Excel(counter) // This function is used to create instances in Excel.
{
var str;
for(var i = 0; i < newQuestionIds.length; i++)
{
str = Sys.Process("iexplore").Page("*").Panel(1).Panel(0).Panel("accordion_panel").Panel(3).Panel("innerQuestionDiv").Panel(0).Table("tableQue").Cell(i, 0).Panel(0).Panel("q_question_" + newQuestionIds[i]).Label("q_questionLabel_" + newQuestionIds[i]).innerText;
str = trim(str);
if((CompareProperty(str, cmpEqual, "List Custom List Box", true)) || (CompareProperty(str, cmpEqual, "List Custom Drop Down", true)) || (CompareProperty(str, cmpEqual, "List Custom Check Box", true)) || (CompareProperty(str, cmpEqual, "List Custom Radio Button", true)))
{
// do nothing becoz Custom List is not available in excel spreadsheet
}
else
{
fn_Edit_Pencil(i);
// fn_Drag_Element_Window_Excel();
Delay(2000);
if(CompareProperty(str, cmpEqual, "Date", true))
{
fn_Date_Element_Instance_Excel("B1");
fn_Write_Into_Log_File("• Element \"Date\" Instance " + counter + " in Excel is created successfully. => " + new Date() + "\n");
Delay(2000);
}
else if(CompareProperty(str, cmpEqual, "Currency", true))
{
fn_Currency_Element_Instance_Excel("B2");
fn_Write_Into_Log_File("• Element \"Currency\" Instance " + counter + " in Excel is created successfully. => " + new Date() + "\n");
Delay(2000);
}
else if(CompareProperty(str, cmpEqual, "Text", true))
{
fn_Text_Element_Instance_Excel("B3");
fn_Write_Into_Log_File("• Element \"Text\" Instance " + counter + " in Excel is created successfully. => " + new Date() + "\n");
Delay(2000);
}
else break;
}
}
fn_Save();
}thanks
Related Content
- 11 years agoc_jones_ismail
- 4 years agokiranka
Recent Discussions
- 2 hours agoSvetaG