Current Articles | Categories | Search | Syndication

Comments
by Rod on Friday, June 27, 2008
This is not working on IE 7. Is the some simple way like in WATIN labrary or here is all in this complicated way?
by David N on Monday, July 07, 2008
Hi Rod,

Here is a sample script that uses the Find method to search for an object on a web page (works in IE6 and IE7) starting from a deep level of the object hierarchy.

[JScript]
function Test()
{
var p = Sys.Process("IEXPLORE");
var page = p.Page("*");
page.ToUrl("http://www.automatedqa.com");

var AQtimePanel = page.Panel(0).Panel(0).Panel(1).Panel("pageTextLoose").Panel("productBox").Panel(0).Panel(1).Panel(0);
var overviewLink = AQtimePanel.Find(ConvertArray(["innerText", "tagName"]), ConvertArray(["Overview", "A"]), 10);
Log.Message(overviewLink.FullName);
overviewLink.Click();
}

function ConvertArray(AArray)
{
// Uses the Dictionary object to convert a JScript array
var objDict = Sys.OleObject("Scripting.Dictionary");
objDict.RemoveAll();
for (var j in AArray)
objDict.Add(j, AArray[j]);
return objDict.Items();
}

--
Best regards,
David
AutomatedQA Support
Click here to post a comment

AQA Products

TestComplete Strengthen your software with automated testing. Free trial. AQtime Everything you need to make your application fast and lean. Free trial. AQdevTeam Help your team work smarter with a complete project view and graphical workflow. Free trial. Automated Build Studio Transform error prone, complicated build and release tedium into a simple, clean automated process. Free trial.
AutomatedQA Home