Forum Discussion
8 Replies
Sort By
- AlexKarasChampion Level 3Hi Muhammad,
You should use either Eval() (for VBScript and, possibly, for JScript/C#Script/C++Script) or evaluate() (for DelphiScript) function provided by the corresponding scripting language that you are using for the tests. See the documentation for the scripting language for more details. (Note: C#Script and C++Script are actually JScript with modified syntax, so you should read JScript documentation is you use any of these languages.)
For the VBScript the code will be like this:
strObject = "Sys.Process(""Notepad"")"
Set obj = Eval(strObject)
For DelphiScript the code will be like this:
strObject := 'Sys.Process(''Notepad'')'
obj := evaluate(strObject)- adithyasekarOccasional Contributor
How should we achieve the same using python in Testcomplete. I understand evaluate() and Eval() can be used for jscript and delphy.
Can somebody please help on this. its an urgent requirement.
- tristaanogreEsteemed Contributor
Quick google search found that Python supports an "eval()" method as well. have you tried that?
- mazhar555ContributorThanks, i am using VB Script and new to automation. What if i want to do the same in KeywordTest?
- shashidharslsNew ContributorHi Team,
I want to set_color of a object. I have to convert the hex color pattern (Ex: "000080") to object to pass it as a parammeter to PathOfObject.set_SelectedColor(). Please help me to do this conversion in Vb Scripting.
Note: PathOfObject.set_SelectedColor "#000080"
It shows the following error if I run the above line of code.
Object of type "System.String" cannot be converted to type of "System.Windows.media.Color type"
Related Content
- 5 years agosenthkum
Recent Discussions
- 3 hours agoSubhraDas
- 9 hours agoJacobjacob44