Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with file "save as dialog box"
#1
Solved: 10 Years, 9 Months ago
hi all ,

i am automating a web application . The web application has a test case to download different version of a file by clicking on download button.
following is the record using QTP
------------------------------Cut from original code----------------------
Code:
Dialog("0% of 15_pkgId129170115_2.5.4.").Dialog("File Download").WinButton("Save").Click
Dialog("0% of 15_pkgId129170115_2.5.4.").Dialog("Save As").WinEdit("File name:").Set "c:\s40selfupdater\data\test.jar"
Dialog("0% of 15_pkgId129170115_2.5.4.").Dialog("Save As").WinButton("Save").Click
Dialog("0% of 15_pkgId129170115_2.5.4.").WinButton("Close").Click
---------------------------- End of Cut---------------------------------
this cod is for downloading a file called ""15_pkgId129170115_2.5.4"" as you can see from code
now the problem is :if the file name changes from 15_pkgId129170115_2.5.4 to some "xyz" QTP displayed an error "The "0% of XYZ." Dialog object was not found in the Object Repository. which is quite genuine.

now i want to script it in such a way that even if file name changes to xyz it should work without any error.

I tried with following but failed:
---------------------------try 1------------------------------------
Code:
Dialog(*).Dialog("File Download").WinButton("Save").Click
Dialog(*).Dialog("Save As").WinEdit("File name:").Set "c:\s40selfupdater\data\test.jar"
Dialog(*).Dialog("Save As").WinButton("Save").Click
Dialog(*).WinButton("Close").Click
--------------------------try1 end----------------------------------

--------------------------try2---------------------------------------
Code:
Dialog("File Download").WinButton("Save").Click
Dialog("Save As").WinEdit("File name:").Set "c:\s40selfupdater\data\test.jar"
Dialog("Save As").WinButton("Save").Click
Dialog("*").WinButton("Close").Click
-------------------------0try2 end----------------------------------
Reply
#2
Solved: 10 Years, 9 Months ago
hi guys ,

i tried one more thing
enabling the smart object identification property of the dialog box.
but its disabled by default . i cant enable it
Reply
#3
Solved: 10 Years, 9 Months ago
In your repository change the text '0% of 15_pkgId129170115_2.5.4' of Dialog("0% of 15_pkgId129170115_2.5.4.") object to
'.* of .*'

Reply
#4
Solved: 10 Years, 9 Months ago
hi @saket,

thanks a lot . its working Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to update CSV File and need to Save same CSV File kotaramamohana 1 3,321 10-24-2015, 08:40 AM
Last Post: tigerliew
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,301 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
Sad Save data from pdf file to a word doc Amar 0 2,411 12-12-2013, 12:29 PM
Last Post: Amar
  Read text from text file and save it into a variable in qtp arpan 3 12,102 06-19-2013, 08:34 PM
Last Post: arpan
  Problem with Multiple rows retrieval from mySQL and save it some variable Dejavu 1 1,965 03-15-2013, 02:52 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)