Hi every body, I am new to QTP.pls help me if anybody knows
the solution.
Here is my doubt:
I have 3 excel sheets in my local drive out of which one is
password protected and i want to get the data of all these
xL's either by importing or by reading the data finally i
have to update this data in the website.(and the site is
secured site)
I tried by importing all XL"s one by one but couldn't do so.
plss send me the code or atleast suggest me the approach.
Thanks in Advance
Padmaja
Answers were Sorted based on User's Feedback
Answer / sonia
Password protected files cannot be imported in QTP. First,
you have to modify the file permissions make
it ‘Unrestricted Access’. Then only you can work that file.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / swapna
Hi ,
There is simple solution which you need to do is try to
access the excel through by creating the object.
See sample script
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function HomePage()
Dim fso, Root, HtmlResFile
Dim appExcel
'Defining the File object
Set fso = CreateObject("Scripting.FileSystemObject")
Set appExcel = CreateObject("Excel.Application")
'Setting the path
'Root = "C:\\Documents and Settings\\sragi\\Desktop\\MCGATF-
WALTHAM\\KR2xRegressionSet_Framework\\"
'Root = App.Path + "\KR2xRegressionSet_Framework"
Root = App.Path
ExcelPath = Root + "\\Qtp_Excel_Results\\Results.xlsx"
'Creating html file
Set HtmlResFile = fso.CreateTextFile(Root
+ "\Qtp_Html_Results\Regression_Summary_Results.html",
True, False)
'Closing the Html created file
HtmlResFile.Close
'Opening the above created html file for writing
Set HtmlResFile = fso.OpenTextFile(Root
+ "\Qtp_Html_Results\Regression_Summary_Results.html", 2,
True)
Set appExcel = CreateObject("Excel.Application")
'Open the Result file
appExcel.Visible = True
Set objWorkBook = appExcel.Workbooks.Open(ExcelPath)
'Open the Result file
Set objSheet = appExcel.Sheets(1)
objSheet.Select
With objSheet
TotalExecutedTcs = .Range("C7")
End With
For j = 11 To objSheet.UsedRange.Rows.Count
Status = objSheet.Range("G" & j)
If Status = "Pass" Then
Passcount = Passcount + 1
Else
Failcount = Failcount + 1
End If
Next
TotalPass_Percentage = Round((Passcount * 100) /
TotalExecutedTcs)
TotalFail_Percentage = Round((Failcount * 100) /
TotalExecutedTcs)
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
this function will read the data from the excel and reports
to the html output. This is not the direct solution of your
problem but the methods which are used will solve your
problem...
Search in google to read the excel which has password
protection. Already I have posted the code in the QTP Blog
earlier.... along with it you can get other experts code...
Thanks..
Happy learning...
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / nani
Hi,
As per my knowledge.
generally you will know how to import the data from excel
sheet to web application right.
and you are saying one is password protected one so do one
thing for that one
you can write a script and give tha password then in the
general way you can import the data.
| Is This Answer Correct ? | 0 Yes | 3 No |
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
Hi. I have completed B.TECH(CS) , But I will go to "SECURITY CONSOLE OPERATING" [C.C CAMERA abservation]. IF interviwer asks " Why you choose this job ?" What we will say? urgent.........................urgent...........
Could you please suggest a book to start with QTP and also a book for advanced concepts?
Can we test GUI of the application using QTP.? How.?If possible briefly explain process.?
How do I modify a value of an elemnt which is not the first one in xml file? My sample XML file is like: <Environment> <Variable> <Name>Name</Name> <Value>Uday Kumar</Value> </Variable> <Variable> <Name>Designation</Name> <Value>Senior Software Engineer</Value> </Variable> </Environment> for example, I'd like to change the value 'Senior Software Engineer' to 'Student' in the second element. How do I do it in QTP?
I have two For loop, first For loop does is creates a customer and input the customer info and then the second for loop within the first for loop does the follows which is capture the customer name and verify the with the data within the datatable. The problem I am coming across is that when it goes through the second time creating another customer and then verify the second customer then it creates the following during runtime. I want is to have the customer2 below Customer1 under the Customer_from_Apps. Any help will be greatly appreciate it. Customer Customer_from_Apps Customer_from_Apps1 Customer1 Customer 1 Customer2 Customer2 Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Customer_Val= Datatable.GlobalSheet.AddParameter ("Customer_from_Apps",runtimevalue) row=datatable.getsheet("Global").GetRowCount For x=1 to row datatable.SetCurrentRow(x) Data_Val=Datatable.Value("Customer",dtGlobalSheet) If (trim(Customer_Val)=trim(Data_Val)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val else Reporter.ReportEvent micFail, "Cusotmer validation unsuccessful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val End If Next
what are the disadvantages of descriptiveprograming
What is diff betwee datatable.importsheet "path" and datatable.import
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail
hi Friends ,willany body tell me what is the Scope for the automation Testing inht Future is their Or not And what is the Top Most Level in the testing section according the Pay scale
Can we use Virtual Objects in Discriptive Programming?