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)
- courtenayp2 years agoContributor
hi this doesnt solve my issue as i can see you are using the new "label" child object of the alert/confirm that now appears to be there, there are still other parts of text within theses objects that is totally unrecognisable.
anyway, after also jumping on the post about the OK buttons not working and that is still not resolved with chrome 116 and TC15.55 i have reverted back to my old version of chrome, because im wasting time trying to work out a combination that works again - it seems ok with old chrome and TC15.53 (i tried TC15.55 and that version does not recognise alert/confirm object at all going back to chrome 106, and i tried TC15.54 and that version does not recognise all alert/confrim message content + has a child "label" object now being added which contains some of the message content of the alert/confirm object)
to summarise (all below using chrome 106, also 114 seems fine)
TC15.53 - recognises the alert/confirm fine including the text within it under a Message property
TC15.54/55 - recognises the alert/confirm fine, but only recognises part of the text in it under a NEW child object with ObjectIdentifier "Message" and ObjectType "Label"
Below screenshots show the TC15.55 2x objects found with label child object only showing irst line of confirm dialog, and TC15.53 a single alert object with message property containing the ALL the text
there is clearly a change in TC15.54
Related Content
- 6 years ago
- 11 years ago
Recent Discussions
- 22 minutes ago