How to learn to code in TestComplete script?
Hi,
I am newbies to TestComplete and still learning/understanding on how to code in script. Do you know where can I find library document to refer to? I tried to find in smartbear online/google, there is some samples but does not really have the info I need. Eg below.. I would like to find click the first Enter link found in a table but I just not sure what is the strong type declaration and syntax.
function Click_Enter_Link()
{
var obj = Aliases.browser.pagePageName.Frame("main").EvaluateXPath("//table[@class='tablegrid']//a",true);
if (obj != null)
{
// Loop all the Atag elements and If obj innertext is 'Enter', click it --> How to code this????
}
else
{
// If the element was not found, post a message to the log
Log["Error"]("The element was not found.");
}
}
Hi Samantha_chin,
Our TestComplete documentation contains a lot of samples for all supported languages. As you are calling the EvaluateXPath method, I recommend that you review the Finding Web Objects Using XPath Expressions ( http://smartbear.com/viewarticle/71392/ ) article with some samples you may find useful.
In addition to this, TestComplete provides the Recording feature. By using it, you can create tests automatically. Perhaps, it will help you avoid creating tests anew.
One more great support resource is the How To section: https://support.smartbear.com/howto