Forum Discussion
Try the following JavaScript code to test TestComplete Dialogs Sample
function DialogTest()
{
Browsers.Item(btEdge).Run("http://secure.smartbearsoftware.com/samples/testcomplete15/dialogs/");
var page = Sys.Browser("edge").Page("http://secure.smartbearsoftware.com/*");
// Alert sample
var btn1 = page.Panel("page").Panel("dialogBox").Link(0);
btn1.Click();
Log.Message(page.Alert.Label("Message").Text);
aqObject.CheckProperty(page.Alert.Label("Message"), "Text", cmpEqual, "Alert button is pressed.");
page.Alert().Button("OK").Click();
// Prompt sample
var btn2 = page.Panel("page").Panel("dialogBox").Link(1);
btn2.Click();
Log.Message(page.Prompt.Caption("Message").Text);
aqObject.CheckProperty(page.Prompt.Caption("Message"), "Text", cmpEqual, "Please enter your name");
page.Prompt.TextBox("Value").SetText("SmartBear");
Sys.HighlightObject(page.Prompt().Button("Cancel"));
page.Prompt().Button("OK").Click();
// Confirm sample
var btn3 = page.Panel("page").Panel("dialogBox").Link(2);
btn3.Click();
Log.Message(page.Confirm.Label("Message").Text);
aqObject.CheckProperty(page.Confirm.Label("Message"), "Text", cmpEqual, "Press a button");
Sys.HighlightObject(page.Confirm().Button("Cancel"));
page.Confirm().Button("OK").Click();
// OnBeforeUnload sample
var link1 = page.Panel("page").Panel("dialogBox").Link(3);
link1.Click();
Log.Message(page.Confirm.Label("Message").Text);
Sys.HighlightObject(page.Confirm().Button("OK"));
page.Confirm().Button("Cancel").Click();
}
Works fine in Edge v116.0.1938.69 (Official build) (64-bit) and Google Chrome v116.0.5845.141 (Official Build) (64-bit)
- Hassan_Ballan8 days agoRegular Contributor
As "Data Generator AI plugin" was working in previous TC/TE version, try to uninstall and reinstall TC/TE. Also login to the session that will run and attempt to reconfigure you test "AI Test Data Generation"; hopefully you will be prompted to to agree and save.
If it still fails contact support and as a work around fall back to previous version of TC/TE.