Question
Cognizant
IN
Last activity: 12 Oct 2017 1:05 EDT
Regarding web application
Hi,
I would like to know how we could interrogate onward date and return date in an web application where the user have to select the date from a calendar.
Thanks in advance.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
You will need to use the ExecuteScript on the Webpage control through test methods in order to artificially raise whatever event that the textbox is looking for. The method below is an example of what you might pass as a parameter (note: you will need to have everything on one line since test methods only accepts data on one line). You may need to investigate the event that is triggering the calendar to show.. usually I find this through the F12 Developer Tools in IE.
function raiseEvent(htmlId) {
var target = document.getElementById(htmlId);
var eventObject = document.createEvent("Event");
eventObject.initEvent('click', true, false);
target.dispatchEvent(eventObject);
}
Pegasystems Inc.
US
Are you having trouble interrogating the control or just having trouble selecting a date with the control?
Cognizant
IN
I am able to interrogate the onward and return date textbox. But after clicking on the textbox, when the calendar box appears, I am not sure on how to interrogate the calendar box as when I try to drag and drop the bull's eye, the calendar box disappears.
Pegasystems Inc.
US
A html event is raised when you click into the textbox - this event is calling the javascript that shows the calendar box. In order to interrogate it, you will need to raise the event through test methods on the textbox so that the calendar shows. Then you can drag the bulls-eye onto the control. What version of Pega Robotics are you using?
Cognizant
IN
Pega Robotics Studio v8.0
Pegasystems Inc.
US
What version of 8.0?
Cognizant
IN
8.0.1016.0
Accepted Solution
Pegasystems Inc.
US
You will need to use the ExecuteScript on the Webpage control through test methods in order to artificially raise whatever event that the textbox is looking for. The method below is an example of what you might pass as a parameter (note: you will need to have everything on one line since test methods only accepts data on one line). You may need to investigate the event that is triggering the calendar to show.. usually I find this through the F12 Developer Tools in IE.
function raiseEvent(htmlId) {
var target = document.getElementById(htmlId);
var eventObject = document.createEvent("Event");
eventObject.initEvent('click', true, false);
target.dispatchEvent(eventObject);
}
TATA Consultancy Services Ltd
IN
For this context can you try to set the value of text box directly using .Text or .innerText property of the textbox.