איך לתכנת ב-JavaScript על QTP.

moranedotomi

New member
איך לתכנת ב-JavaScript על QTP.

היי אני מתכוונת איך לתכנת ב-JSעל QTP. כלומר,אני צריכה להוסיף קטע קוד בJS ל-script קיים שלי ב-QTP(המכיל כמובן קוד ב-VBScript). לפי מיטב ידיעתי ישנה אופציה לשלב קובץ import המכיל קטע קוד ב-JS וניתן להשתמש מה-QTP במטודות שלו. השאלה: -אך בעצם מבצעים את ה-import. -אך מבצעים call function מהאפליקציה של ה-QTP(למטודות של הקובץ JS החיצוני). תודה מראש מורן
 

erandd

New member
מצאתי משהו

תחפשי על INCLUDE STATEMENT בHELP של QTP מתוך הדף: Include Statements If you have .js and .vbs files from previous Windows Script Host projects, a .wsf file enables you to use them with Windows Script Host. A .wsf file encapsulates a library of functions that can in turn be used by multiple .wsf files. The following example shows a .wsf file that includes a JScript file (fso.js), plus a VBScript function that calls a function (GetFreeSpace) in the included file. The contents of fso.js are also shown. <job id="IncludeExample"> <script language="JScript" src="FSO.JS"/> <script language="VBScript"> ' Get the free space for drive C. s = GetFreeSpace("c:") WScript.Echo s <sScript> </job> The fso.js file contains the following: function GetFreeSpace(drvPath) { var fs, d, s; fs = new ActiveXObject("Scripting.FileSystemObject"); d = fs.GetDrive(fs.GetDriveName(drvPath)); s = "Drive " + drvPath + " - " ; s += d.VolumeName; s += " Free Space: " + d.FreeSpace/1024 + " Kbytes"; return s; }
 

moranedotomi

New member
erandd-תודה רבה

בהחלט עזרתך הניבה פרי... חייבת לציין שאפילו התמיכה של Mercury ענו בתשובה שלילית(כלומר,אין תמיכה ב-JavaScript). המלצתי לעמיתיי לעבודה על הפורום הנ"ל שתחת ניהולך... תודה מורן
 
למעלה