Question
ServiceNow
JP
Last activity: 26 May 2017 20:44 EDT
Dropdown invoking jQuery
Hi. Can we somehow automate the following Web page to select the date of birth?
https://www.orixlife.co.jp/sim?index=5&p=3G&p=4C&p=4A&p=1V&genderctl=1
When it is operated by human, it works fine. But if you use it from Robot just with using SelectItemByXxx methods, the submit button in this page cannot be pushed.
It seems that this page invokes jQuery each time we choose Year and Month:
<label><strong>生年月日</strong>
<select name="year" id="input-dialog-year" data-bind="options: birthdayYear, optionsText: 'text', optionsValue: 'value', value: selectedBirthdayYear,event: { change: $root.setMonth()}"></select>年
</label>
<label>
<select name="month" id="input-dialog-month" data-bind="options: birthdayMonth, optionsText: 'text', optionsValue: 'value', value: selectedBirthdayMonth,event: { change: $root.setDay()}"></select>月
</label>
<label>
<select name="date" id="input-dialog-date" data-bind="options: birthdayDay, optionsText: 'text', optionsValue: 'value', value: selectedBirthdayDay"></select>日
</label>
To invoke the event, I tried using RaiseEvent method to Year and Month dropdowns with the following options, so far with no luck:
- "onselect"
- "onchange"
- "onblur"
Any ideas to automate this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
ServiceNow
JP
Since it was too difficult to know the combination of the events to be raised with RaiseEvent mothod this time, I used SendKeys method for Robot's pretending to be a human, which worked fine.
The following Automation (the first image file) fills the Excel (the second image file) with insurance premiums gathered from the Web site. Just for an information sharing with the others.
Thanks,
Moritaka Kanai
Pegasystems Inc.
US
- Look at the code behind the Submit button. Sometime you will find that the button does not become enabled until an event is raised.
- Using Developers Tools you can look to see which events are being generated when you manually do the selection.
You are on the right track with using RaiseEvent. It just takes some investigation to learn which events to raise.
ServiceNow
JP
Thank you for your note. Based on the console output with "monitorEvents(window);" in Chrome developer mode, I tried ReiseEvent method with onclick, onchange (before and after setting the value), onmousedown, onmouseup. But still, the submit button cannot be pushed. As far as I looked into the HTML source code, just change event seems to be needed though. No other things to be considered?
Pegasystems Inc.
US
I often use the TestMethods options when in interrogation mode to try various combinations of RaiseEvent. But it is hard to answer without seeing the application. I had an application on one project in which the visible controls set some hidden controls that were then submitted. We had to interrogate the hidden controls and set them to be able to control the app.
ServiceNow
JP
Thank you again.
According to "Test Target Methods", when selecting a value from the dropdown menu in this Web page, the following events occurred sequentially:
GotFocus
Click
TextChanged
SelectedIndexChanged
Click
UserModified
LostFocus
Assuming the above, how can we "emulate" the behavior? Not all of them can be seen in the list of the RaiseEvent method.
Ernst & Young LLP
US
Hi Kanam,
I am having a similar issue. Where to find "Test Target Methods"?. How to find a list of events getting fired on clicking a dropdown.
Thanks
Sriram
ServiceNow
JP
Hi. "Test Target Methods" can be launched as follows:
1. While interrogating the Web application, right click on the target, and select "Test Target Methods".
2. Check "Show Inherited", then you will see the events occurred on the relevant object are displayed in the bottom right area.
Ernst & Young LLP
US
Thank you Kanam.
Accepted Solution
ServiceNow
JP
Since it was too difficult to know the combination of the events to be raised with RaiseEvent mothod this time, I used SendKeys method for Robot's pretending to be a human, which worked fine.
The following Automation (the first image file) fills the Excel (the second image file) with insurance premiums gathered from the Web site. Just for an information sharing with the others.
Thanks,
Moritaka Kanai
Ernst & Young LLP
US
Hi Kanai,
Is it possible to send keys for a Web application. Would you please give detailed steps to send key, "Enter Key" to a drop down.
Thanks
Sriram
ServiceNow
JP
Sriram,
You can try interrogating the Web browser's title bar. Then you will see the entries in the Object Explorer that you can choose SendKeys method for.
Thanks,
Moritaka Kanai