Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code issue
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi ,

I have excel sheet name as Book4.xls,in that 1 sheet having the Coulmn names as Script_Path,Repository_Path,Flag.

Script_path is nothing that iam giving the path of the my .vbs file and Repositopry _path is my repository path(.tsr file) and Flag value either "y " or "n".if flag="y".


Code:
datatable.AddSheet("newsheet")
datatable.ImportSheet "c:\tdf\spreadsheet.xls","sheet1","newsheet"
n=datatable.GetSheet("newsheet").getrowcount
For i = 1 to n
   datatable.SetCurrentRow(i)
   flag=datatable.value("Flag","newsheet")
   If flag = "y" Then
         scriptpath=datatable.Value("Script_Path","newsheet")
         objpath=datatable.Value("Repository_Path","newsheet")
      

       executefile scriptpath
      

   End If
Next

***//Pls help me,and correct the code
wen ever executing this script getting eroor as " expecting "if"

and as well as well how to add objpath to specific scriptth path ?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
I am not able to get your second question -"how to add objpath to specific scriptth path ?" exactly what do you want to do?
I dont see any issue with your code that you have pasted. I tried to execute that and not found any error as mentioned.
Can you check if there is any IF statement before or after this piece of code and not properly handled?

Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
saket ,create a excel sheet and create a columns as i mentioned in the code and give the paths and execute the scenario...it wont working thats my problem.

coming to second point --its resolved Repositories.add Objpath.

Pls execute one scnario as i mentioned in the earlier..its not working ..pls suggest
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
what is the error that you are getting and at which line?

Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
iam not getting error ,wen ever i execute it has to execute that .vbs file .which i mentioned in the excel
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
unfortunately I dont get any error at my side, I am able to execute a vbs with the code.
Can you try running the vbs file? or run only the ExecuteFile statement.

I doubt there may be some issue with your vbs file.

Reply
#7
Solved: 11 Years, 3 Months, 4 Weeks ago
My vbs file code is :

sysstemutil.run "Flight app path in my system"

Code:
Dialog("lOgin").winedit("Agent Name").SET "MADHU"
Dialog("lOgin").winedit("Password").SET "MERCUTY"

dialog("Login").Winbutton("ok).click
saved this in my local machine as .vbs file.That path i given at execl sheet and recoded obects .tsr file path stored in the some path that path al;so i given in excel .

will u place ur code and steps pls .did u changed anything in the code?
Reply
#8
Solved: 11 Years, 3 Months, 4 Weeks ago
why do you need to put those statements in a vbs file?
You will not able to run your vbs file with these code in a vbs file.

You should use these statements in the QTP script itself.

Reply
#9
Solved: 11 Years, 3 Months, 4 Weeks ago
Did this code is not execute?pls paste ur vbs file .that i would execute .

Iam running one action.
pls attache ur vbs file and tsr files which are used in this scenario.pls saket
Reply
#10
Solved: 11 Years, 3 Months, 4 Weeks ago
i did not get you, which vbs file you want me to paste here?

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)