Forum Discussion

MonicaTeotia's avatar
Occasional Contributor
2 years ago

Unable to Select OK on browser confirmation pop up


In my application, when i click on delete button a browser confirmation pop up is displayed with Ok and Cancel buttons however I am not able to select either ok otr cancel options on the pop up.

I used below code

function Confirm_Demo()
  var url = "myapplicationurl";

  var page = Sys.Browser().Page("*myapplicationname/");
  var link = page.FindElement("//a[contains(text(),'Show Confirm')]");

  Log.Message("Message text: " + page.Confirm.Message);

For me it fails to locate the element ("//a[contains(text(),'Show Confirm'). I am unable to inspect and write the locator for OK button on the pop up.

Please suggest how to locate it

Or is there any other way of handling the confirmation pop up