Currently, I am performing non-regression tests using the Perl package Selenium::Remote::Driver. In order to retrieve a windows Confirm Box, I understand that I need to execute some Javascript snippet code. Typically, I can manipulate web page behavior not covered in the Selenium::Remote::Driver package by utilizing Javascript code with a selector (as shown below). However, in this specific instance, I am unable to access my "Confirm Box" element for inspection, hindering my ability to locate a selector or xpath.
Note: My objective is not to confirm the existence of this alert ("Confirm Box"). I am already aware of its presence on my webpage and do not require confirmation.
In addition, I must utilize the following Javascript snippet as an example:
my $script = q{
var arg1 = arguments[0];
var elem = window.document.findElementById(arg1);
return elem;
};
my $elem = $driver->execute_script($script,'myid');
$elem->click;
Furthermore, the code snippet below includes the section of code where my "Confirm Box" lies:
if (confirm("Are you sure?")) {
var promises = [];
CW.showLoadingPanel();
$.each(dataGrid.getSelectedRowsData(), function() { ... }
...
};
Given this, how should I approach resolving this issue?