Not working events of control of DevExpress
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not working events of control of DevExpress
Control - DevExpress.ExtraEditors.SpinEdit, event - EditValueChange.
When record is working.
When Playback is not working.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A bit thin on information here.
What do you mean? "It doesn't work" What does happen and what do expect to happen?
How is the event triggered? (This can be specified - https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsRepositoryRepositoryItem_Edi...
Is your test doing whatever action triggers the event? Also, how are you changing the value? (keys method, manually changing the property, using the spinners, etc etc) Depending how you do it, it may or may not be triggering the event.
If you want good answers, it helps to include enough detail in your question ....
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you change the value in the form of some action to take place, which is called by a method "EditValueChange". When programm is working in testсomplite these actions do not happen.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not a method. It's an event. They're different.
The event is triggered by something happening on the form (changing a value in this case).
But there are usually several ways you can alter a value using scripts. (keys, directly changing a property, using the spinner up/down arrows in the field)
What you need to know is what triggers the event. The developers should be able to tell you that. It's a configurable part of the control. The common one is leaving the field. ie The event won't happen until you leave the field. You may need to send an <ENTER> or <TAB> once you have set the value in the field.
When you recorded it, you may have just clicked from field to field entering values. If so, it may not be detecting that you've left the field as you didn't record and <ENTER> or a <TAB> when exiting the field.
Or are you trying to call the event directly? You probably shouldn't be. It's an event. Something is supposed to happen to trigger it, it's probably not designed to be called directly by scripted automated tests.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The test in jawascript. in Appendix of this test result
function Test1()
{
var loadData;
var frmLoadData;
var panelControl;
var textBoxMaskBox;
TestedApps.LoadData.Run();
loadData = Aliases.LoadData;
loadData.frmLogin.PanelControl1.pnButtons.cmbOK.ClickButton();
loadData.XtraMessageBoxForm.SimpleButton.ClickButton();
frmLoadData = loadData.frmLoadData;
panelControl = frmLoadData.pnCommand;
panelControl.rgMode.ClickItem("Load multiple periods");
textBoxMaskBox = frmLoadData.pnPeriods.nupMultPer.TextBoxMaskBox;
textBoxMaskBox.Drag(12, 7, 38, 5);
textBoxMaskBox.SetText("40");
textBoxMaskBox.Keys("[Enter]");
panelControl.pnButtons.cmbExit.ClickButton();
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, looking at that, I'm guessing you're expecting the event to trigger once you enter "40" into the text box? But it doesn't.
Does [ENTER] cause it to exit the field? Maybe try [TAB] instead?
But the easiest thing would be to ask the developers what activates the event trigger.
(The action after entering "40" seems to be clicking an exit button of some sort? Are you allowing enough time for the event to happen before you click this exit button?)
**EDIT**
I just noticed, you're using SetText to set the value. Maybe try using Keys instead. I think SetText is like changing a property of the control. Keys is like the user actually keying things in. I've had occasions where SetText appered to work, but the value was not retained. Using Keys, it was fine.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tab - I did - the same result. Delays put - did not help.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Keys instead of SetText?
After that, you'll need to speak to the devs and find out what the trigger is. We're guessing at the moment ...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the "key" helped, thank you
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Makes sense.
For closest simulation of a user typing, I've found Keys is usually the way to go.
