Forum Discussion
Hi Savitri,
If you want to get the value of the TcxMRUEdit box, you can use the Text property for this. If you want to get the actual mask accepted by this control, you can use the Properties.EditMask property. For example:
var maskEdit = Sys.Process("MyProcess").VCLObject("MyForm").VCLObject("MyMaskEdit");
Log.Message(maskEdit.Text);
Log.Message(maskEdit.Properties.EditMask);
If you need something else, please clarify your question.
Hi Nikita,
The DDT Drivers feature is very useful for those who prepare their custom data sheets before running a test and they know all information required to access data. It seems that you are facing another task which cannot be solved easily while using DDR Drivers. Could you please describe the task you have in detail? Probably, I will be able to find an appropriate solution for you.- NandeeshOccasional ContributorHi david....
I am pasting part of code here.....
/* strDob is a string read from excel sheetIf not IsNull(strDob) Then
ctlCheckBox.maskedTextBoxDateOfBirth.Click() /* path to DOB masked text box in my
applicationctlCheckBox.maskedTextBoxDateOfBirth.wText=strDob
end if
Here just like copy,paste i write strDob to a masked text box in my application all dd/mm/yyyy at a time.....
but i want to write to it literal wise.Is there any other properties available..?
I tried the "TcxMRUEditProperties" like this in my code.....maskedit=TcxMRUEditProperties("Aliases.Patient_Administration.EditPatientDialog.groupBoxPatient.maskedTextBoxDateOfBirth.Mask")
Log.message(maskedit.text)
Log.message(maskedit.properties.EditMask)
Am i using the syntax properly....?as i am encountering an error here saying"Type mismatch :TcxMRUEditProperties"
please let me know if u need any more details....
Hi Savitri,
No, you are using incorrect syntax. There is no way to perform type casting like in C++ or Delphi languages while you are working with scripts, since scripting languages are typeless languages. Please find more information on scripts in the Writing Scripts - Overview help topic.
You can do what you want in the following way:
var maskEdit = Aliases.Patient_Administration.EditPatientDialog.groupBoxPatient.maskedTextBoxDateOfBirth;
var maskEditProperties = maskEdit.Properties;
Log.Message(maskEdit.Text);
Log.Message(maskEditProperties.EditMask);/* strDob is a string read from excel sheet
If not IsNull(strDob) Then
ctlCheckBox.maskedTextBoxDateOfBirth.Click() /* path to DOB masked text box in my application
ctlCheckBox.maskedTextBoxDateOfBirth.wText=strDob
end if
Doesn't the code work for you? If it does not, please let me know what exact error is posted to the log and what the exact value of the 'strDob' variable is.- NandeeshOccasional ContributorHi David,
Is there any in built property to check proper Date format in Test Complete....?
Ex: 35/01/1958 or 35/56/1987 these are all wrong date formats.........
I want to give these Format (dd/mm/yyyy) as whole input, and check if it is proper or not...?
Hi Savitri,
You can use regular expressions for this:function test()
{
Log.Message(validateDate("35/01/1958"));
Log.Message(validateDate("35/56/1987"));
Log.Message(validateDate("09/30/2010"));
}
function validateDate(dateStr)
{
var reDate = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20\d{2})/;
return reDate.test(dateStr);
}
Hi Savitri,
Here is another version of this function:function validateDate(dateStr)
{
try {
aqConvert.StrToDate(dateStr);
}
catch (e) {
return false;
}
return true;
}- NandeeshOccasional ContributorHi
Can you please tell me what is the substitute for "continue" statement in VB script with Test complete tool..? as we use "exit for" in place of break.....
I want to use it within for loop like.......
for i=0 to 10
if i<3 then
continue
end if
next
- AlexKarasChampion Level 3Hi Savitri,
There is no equivalent for 'continue' in VBScript.
The possible syntax is:
For counter = start To end [Step step]
[statements]
[Exit For]
[statements]
Next
or
Do [{While | Until} condition]
[statements]
[Exit Do]
[statements]
Loop
or
Do
[statements]
[Exit Do]
[statements]
Loop [{While | Until} condition] - NandeeshOccasional Contributorhi Alexei Karas
thanks for the suggestions......but the given syntax replace the "Break statement" of C,which comes out of loop.
but i want skip the remaining code followed by "continue statement" and go to beggining of the loop.....and continue execution.
please let me know if the question is not clear....
Related Content
- 11 years ago
- 2 years ago
Recent Discussions
- 3 hours ago
- 10 hours ago
Working with Visual Test
Solved2 days ago