Forum Discussion
Aurelien
13 years agoContributor
Hi,
I tried to test using Namemapping configuration for Multilingual applications but the result is not what I expected. I have a create a test.txt with the word "French". I have mapped it and use the wText "French" as unique property of "Edit" object. The three is like this "NameMapping.Sys.NOTEPAD.wndNotepad.Edit". I have copied as new this namemapping and I have change the property of "Edit" object for "English" (I have replaced the word in the test.txt to do so). After I put back the word "French" in the test.txt.
Then I run this code (TestLangue then TestLangue2) in the ProjectSuite:
Sub TestLangue
Call OpenFile("C:\Users\aurnoi1\Desktop\Test.txt")
NameMapping.CurrentConfigurationName = "French"
If NameMapping.Sys.NOTEPAD.wndNotepad.Edit.Exists Then
Call Log.Message("Success")
Else
Call Log.Warning("Fail")
End If
NameMapping.Sys.NOTEPAD.wndNotepad.Close
End Sub
Sub TestLangue2
Call OpenFile("C:\Users\aurnoi1\Desktop\Test.txt")
NameMapping.CurrentConfigurationName = "English"
If NameMapping.Sys.NOTEPAD.wndNotepad.Edit.Exists Then
Call Log.Message("Success")
Else
Call Log.Warning("Fail")
End If
End Sub
Sub OpenFile(path)
Dim WshShell
Set WshShell = Sys.OleObject("WScript.Shell")
WshShell.Run(path)
End Sub
The code open the file and validate if the object "Edit" exists. At first it correctly finds it (because the NameMapping is in French), but it finds it even when the NameMapping is in English. And after it proposes me to change English NameMapping because the property wText has changed. So I don't understand how I am suppose to this? Shouldn't it fail when searching for "Edit" object since the property is not the one expected?
My goal is the same that Kay Chamberlain. I have multiple applications supporting multilingual and sometimes the only unique property is a text. So I would like to try to avoid the problem of multiple object with same identifiers by this way.
Please find in attached file the ProjectSuite.
Best regards,
Aurélien
I tried to test using Namemapping configuration for Multilingual applications but the result is not what I expected. I have a create a test.txt with the word "French". I have mapped it and use the wText "French" as unique property of "Edit" object. The three is like this "NameMapping.Sys.NOTEPAD.wndNotepad.Edit". I have copied as new this namemapping and I have change the property of "Edit" object for "English" (I have replaced the word in the test.txt to do so). After I put back the word "French" in the test.txt.
Then I run this code (TestLangue then TestLangue2) in the ProjectSuite:
Sub TestLangue
Call OpenFile("C:\Users\aurnoi1\Desktop\Test.txt")
NameMapping.CurrentConfigurationName = "French"
If NameMapping.Sys.NOTEPAD.wndNotepad.Edit.Exists Then
Call Log.Message("Success")
Else
Call Log.Warning("Fail")
End If
NameMapping.Sys.NOTEPAD.wndNotepad.Close
End Sub
Sub TestLangue2
Call OpenFile("C:\Users\aurnoi1\Desktop\Test.txt")
NameMapping.CurrentConfigurationName = "English"
If NameMapping.Sys.NOTEPAD.wndNotepad.Edit.Exists Then
Call Log.Message("Success")
Else
Call Log.Warning("Fail")
End If
End Sub
Sub OpenFile(path)
Dim WshShell
Set WshShell = Sys.OleObject("WScript.Shell")
WshShell.Run(path)
End Sub
The code open the file and validate if the object "Edit" exists. At first it correctly finds it (because the NameMapping is in French), but it finds it even when the NameMapping is in English. And after it proposes me to change English NameMapping because the property wText has changed. So I don't understand how I am suppose to this? Shouldn't it fail when searching for "Edit" object since the property is not the one expected?
My goal is the same that Kay Chamberlain. I have multiple applications supporting multilingual and sometimes the only unique property is a text. So I would like to try to avoid the problem of multiple object with same identifiers by this way.
Please find in attached file the ProjectSuite.
Best regards,
Aurélien