The below stated function creates a temporary excel file and copies the source excel fileâ€™s contents into it and imports from the temporary excel. We were able to import them properly. QTP 9.2Office 2002 SP3 Post Extras: testking123 Advanced Member Reged: 05/16/08 Posts: 660 Re: Import excel file fails due to invalid file error [Re: ArvindT] I am sure most have seen this problem. http://auctusdev.com/invalid-file/invalid-file-name-error-loading-crystal-report-file.html
So that somebody can help.Thanks, --------------------The issue what you have listed does not exist, works fine in my machine- stupid comment from the developer Post Extras: ArvindT Newbie i am writing code as Option explicit Dim oex,owb,ows Set oex=createobject("excel.application") oex.Visible =true Set owb=oex.Workbooks.Add Set ows=owb.Worksheets("sheet1") ows.name="data" ows.cells(1,1)="username" ows.cells(1,2)="password" ows.cells(2,1)="naresh" ows.cells(2,2)="mercury" owb.SaveAs("C:data.xls") datatable.ImportSheet "C:data.xls","data",1 …….But no data is copying into You need to provide some meaningful name to the sheet that you are going to use. What are cell phone lots at US airports for?
This can be achieved by using the concept of function overriding in QTP. Your cache administrator is webmaster. Related 1QTP 10 - A function return deifferent results for same data in run and debug modes1File Download: Object not Visible0issue with running recovery scenario in QTP through code1newly installed qtp So in this case, if password was exposed in script to unprotect and import then there is no meaning in protecting fields of excel file.My aim is to protect some fields
Guest07 Are there any advantages of coping data into QTP Data Table comparing to getting data directly from excel file? How do you grow in a skill when you're the company lead in that area? And this function will be used in all the test cases. Function fnSetValue(objControl, strColumnName) Dim sReqdValue 'Get value from DataTable sReqdValue = fnGetDataTableValue(strColumnName) objControl.Set sReqdValue End Function Since this function is also a reusable function, you have to add it to the
Step 1: Open QTP, create a new Test Case and save it at any desired location. Datatable Importsheet Invalid File Error Your final code (for the login portion of the script) should look something like this. 'Get the Test Case Name that will be used in fnGetDataTableValue function sTestCaseName = Environment.Value("TestName") 'Open Small observation, when i unprotect the excel sheet problem gone away. https://community.hpe.com/t5/Unified-Functional-Testing/Excel-sheet-import-issue-in-QTP-These-sheets-were-working-fine/td-p/5993723 Step by Step method to Create the First Test Case in the Framework The relatively tougher part here is to write the first script or module and then modify it as
Login Register Login Username: Password: Lost Password? Find Reply ravi.gajul Moderator Posts: 257 Threads: 10 Joined: Oct 2011 Reputation: 1 #2 04-06-2013, 11:54 AM Please see if you are able to import the sheet by right click on That is fine because both the sheet name and the test case name are same. Tool gets restarted and you wont face the issue again.
when I hard coded the value of sTestCAseName..it worked for me…Plz help…Hope u got my point.. http://stackoverflow.com/questions/13062808/while-importing-excel-file-to-qtp-im-getting-the-following-msg-the-operation-f And the new excel file also showed the message once "Invaild file......................." Am Very confused!!!! The Datatable.importsheet Operation Failed. Invalid File I noticed that there was a Microsoft update for Office force fed to me yesterday. it is .xls file only.
As a solution i tried copying the file into new file, and changed the name of the file in the script. http://auctusdev.com/invalid-file/invalid-file-handle-error-is-3.html Invalid file.Line (2): "DataTable.ImportSheet "C:\Sheet.xls",1, 1". Standardisation of Time in a FTL Universe Bravo For Buckets! The custom Set function would look something like this.
What is the 'dot space filename' command doing in bash? So that we can find solution for this. --------------------Cheers, Diwakar Post Extras: Pages: 1 Previous Index Next Threaded Extra information 0 registered and 64 What is the exchange interaction? http://auctusdev.com/invalid-file/invalid-file-dsn-error.html Function file: C:QTP_SAMPLE_SCRIPTS_Nov3_12keyword driven frameworkexcelTest1retrieve value.qfl Line (11): " fnGetDataTableValue = DataTable.Value(strColumnName, "dtDataSheet")".
If you notice the code, you would see that we are first capturing the value from the Data Table in a variable and then we are then using it with the Anish10110 Hi Abhinov, Try to use the excel sheet in xls format. we had similar kind of issue, But It was resolved after saving excel as 97-2003.
You would find that there are 3 sheets in the Workbook - Sheet1, Sheet2 and Sheet3. Community Unified Functional Testing Practitioners Forum CommunityCategoryBoardUsers turn on suggestions Auto-suggest helps you quickly narrow down your search results by suggesting possible Now if you want to run the 2nd test case, you would have to again change the test case name in the function, else it will fail. Here is another piece of information,If I randomly delete one of the sheets (there are 3 sheets and it does not matter which one) the problem goes away.
The system returned: (22) Invalid argument The remote host or network may be down. Thanks Anish10110 Cool.. 🙂 Abhinov HI Anish, sorry for Trouble again…. ..I m now try to to Associate Function Libraries to your QTP Scripts..i m using the 1st method for the If you wish to have a look at those, please visit QTP Framework main page. his comment is here Add the data in the data sheet as shown in the below image.
InputDataSheet_MillimanRegression5--old4.xls 1127 KB 0 Kudos Reply All Forum Topics Previous Topic Next Topic 8 REPLIES Ryoganat1 Regular Advisor Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email And the steps to reproduce the issue. To do this, create a new excel workbook and save it as DataSheet.xls inside your framework folder. (you can give any meaningful name to the Workbook) Step 5: Open the Workbook. That is why the problem is ocurring.There can be another scenario too.IF you are have similar XLS in the same location, this error will occur.