vinodtc
14 years agoContributor
How the Exists function working in webtesting
Hi,
As part of my web testing , i have to execute the testcomplete scripts on web when ever there is a new installation on my web application. I have created different functions by scripting(VB script) and each function is a scenario for me (I have 20 scenarios). Calling these functions in main function as shown below. Problem is, some of the objects are not identifying while script execution and whole script is failing. I have used Exists method to determine the object exists or not and performing the operation on that. Still i am getting run time error. If one function fail with reason of "object not found", no other functions/scenarios are execting and just it is comming out. Please let me know how to use Exists method to identify the objects on web. We are using Testcomplet version 8.0 with DOM model.
main()
{
call function1
call function2
}
function function1()
{
if Sys.Process("iexplore").page("*").Document.All.item(134).exists then
Sys.Process("iexplore").page("*").Document.All.item(134).Click()
else
msgbox "Item 134 not existing"
end if
}
function function2()
{
msgbox "function2"
}
.......
Regards,
Vinod
As part of my web testing , i have to execute the testcomplete scripts on web when ever there is a new installation on my web application. I have created different functions by scripting(VB script) and each function is a scenario for me (I have 20 scenarios). Calling these functions in main function as shown below. Problem is, some of the objects are not identifying while script execution and whole script is failing. I have used Exists method to determine the object exists or not and performing the operation on that. Still i am getting run time error. If one function fail with reason of "object not found", no other functions/scenarios are execting and just it is comming out. Please let me know how to use Exists method to identify the objects on web. We are using Testcomplet version 8.0 with DOM model.
main()
{
call function1
call function2
}
function function1()
{
if Sys.Process("iexplore").page("*").Document.All.item(134).exists then
Sys.Process("iexplore").page("*").Document.All.item(134).Click()
else
msgbox "Item 134 not existing"
end if
}
function function2()
{
msgbox "function2"
}
.......
Regards,
Vinod