Ask a Question

testedapps path

SOLVED
arjun_ta
Contributor

testedapps path

Hi,



i have added Excel in my tested apps, in my system its path is 



C:\Program Files\Microsoft Office\Office14\EXCEL.EXE



but in other system it is



C:\Program Files\Microsoft Office\Office10\EXCEL.EXE



how to make this generic? so that irrespective of Office version it should open the excel file that i want to work on??
1 ACCEPTED SOLUTION

Accepted Solutions
murugans1011
Regular Contributor

RE: testedapps path

 [VBScript]



Set foundFiles = aqFileSystem.FindFiles("C:\Program Files\Microsoft Office\", "Excel.exe",True)

 If Not foundFiles Is Nothing Then

     While foundFiles.HasNext

       Set aFile = foundFiles.Next

        app = TestedApps.Add(aFile.path)

         TestedApps.Items(app).Params.ActiveParams.CommandLineParameters = Chr(34) & "C:\logins.xlsx" & Chr(34)

        TestedApps.Items(app).Run

   Wend

End if



'if u mean something by this then try this and let me know ur results

View solution in original post

8 REPLIES 8
murugans1011
Regular Contributor

RE: testedapps path

Hi u can add tested app at runtime



http://support.smartbear.com/viewarticle/57376/#ID0ELCAC



and u can search for a testedapp and add it from ur script this will avoid dynamic filepath issue at several systems



 Set foundFiles = aqFileSystem.FindFiles("C:\Program Files\Microsoft Office\", "Excel.exe",True)

 If Not foundFiles Is Nothing Then

     While foundFiles.HasNext

       Set aFile = foundFiles.Next

        app = TestedApps.Add(aFile.path)

        TestedApps.Items(app).Run

   Wend
arjun_ta
Contributor

RE: testedapps path

Hi ,



along with the above code i want to open an excel file which i have already created in the path "C:\logins.xlsx"



i e basically i was adding C:\logins in the command line parameters so that when the excel runs it opens the "logins" file



how can i do this??

i am coding in VB
murugans1011
Regular Contributor

RE: testedapps path

 [VBScript]



Set foundFiles = aqFileSystem.FindFiles("C:\Program Files\Microsoft Office\", "Excel.exe",True)

 If Not foundFiles Is Nothing Then

     While foundFiles.HasNext

       Set aFile = foundFiles.Next

        app = TestedApps.Add(aFile.path)

         TestedApps.Items(app).Params.ActiveParams.CommandLineParameters = Chr(34) & "C:\logins.xlsx" & Chr(34)

        TestedApps.Items(app).Run

   Wend

End if



'if u mean something by this then try this and let me know ur results

View solution in original post

arjun_ta
Contributor

RE: testedapps path

Hi Murugan,



Thanks for the quick response , the above code is working fine.



regards,

Arjun
murugans1011
Regular Contributor

RE: testedapps path

glad it helped.



but  remember to remove the testedapp from the list when the testcase execution is completed or else everytime it adds the new testedapp at the beginning of the execution somthing like 



  Excel..Excel1..Excel2....so on 



also u can use  somethin like this



if Testedapp.Count>0 then

 

.....Execute function



End if
arjun_ta
Contributor

RE: testedapps path

is there a code snippet to remove the tested app??
murugans1011
Regular Contributor

RE: testedapps path

yes...add at the end in the above script



Testedapps.Delete(app)  'app contains index no
arjun_ta
Contributor

RE: testedapps path

Thanks once again.



I am facing one more issue , i have raised the  issue in the forum can u please look into this and suggest the solution for the same if possible,appreciate the help.



http://smartbear.com/forums/f78/t90922/sashform/



Above is the link to the issue
cancel
Showing results for 
Search instead for 
Did you mean: