Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to open a file using open file dialog windows vista
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Everybody,

I am trying to open a file using Open file dialog in my web application with QTP. QTP doesn't record the file selction from dialog box. I used object spy and it recognized it as Dialog box. In my object repository it is inserted as a child of borwser window from this dialog popus up.

Now I have used below code condition and its returning true

If Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").Exist Then
MsgBox "The browser exists."
and it TRUE.

But when i try to use other methods of dialog object with below code it gives me a message saying object not visible as shown in attached screenshort


below code also not working
Code:
Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").SetTOProperty "Visible", TRUE
  Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").Click
Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").Activate

Attached screenshort explains the story in more detail. Please suggest a wayout


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hello Umer,

you need to test some setting

1. Select Tools>>Web Event Recording Configuration>>Custom Settings

2. On the left hand side, select WebFile in the Standard Web Objects branch of the Objects pane

3. Select Event>>Add>>onclick

4. Select Always in the Listen column for this event

good luck


Thanks

Mahesh
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
thanks for your reply but perhaps I could not list the complexity of problem earlier. Now I just want to enter path manually but my code clicks the associated browse button and opens the file open dialog

here is more detail

case1:When I Manually enter File path and let QTP click on Webbutton it works Fine

case 2: If QTP Enters File path :,
It does not work at all , in debug mode
i.e. file path is not entered in text box ( whether replay type is mouse or browser event )


Now I have 2 Questions
1. Does QTP , support "set" method for Web file Object
i.e. is it different from set method used for web edit ??
If it does It should enter the text in web file text box always but this does not happen

2. What does it treat web file object, as whether a webedit or webbutton ?


How to enter path using any of the moethods of webfile object
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
any response for above problem Sad All I want is just to enter path directly in the edit box associated with WEBFILE object.
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
I am confused, is this a webfile control or open file dialog? paste the snapshot
if this is a open file dialog, have you tried below
Code:
Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").WinEdit("").Set Your File

Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Here I am making my issue more simpler

I have a main browser window which has a webfile control as shown in attached screen short named browse.jpg. Initially i was trying to automate this way as mentioned below

1-click borse button ( QTP recording it fine)
2- Open file diaplog displayed ( QTP unable to record file slection operation on this window

So descided to skip browse button on the main window and open and set path is associated edit box in webfile control. But webfile.set method didn't worked for me .It is neither getting failed nor setting path strange it is Sad((((((((

After failing in above I thought to write file name in file name box of file open dialog highlighted in blue which worked fine with code statement

'''Browser("ProjectCentre QTP: DropBox").Dialog("Choose file").WinEdit("").Set Your File
''

But when I click open button to select file it gives me error 'object not visible' as shown in man screenshort of my post.

I have tried it to get object at run time and using child object method on this file open dialog but nothing working for me right now

stuck in both places 1- setting path in webfile and 2- sing opne file dialog

I hope I have lited all required details


Attached Files Image(s)
       
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Fyi, We too have faced this issues( SAP-Windows level Objects) and we resolved it with below workaround.

Perform "Low-level recording" for Entering the file path & cliking "Open"
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago
ahhhhhhhhhhhhhhhhh There must be a way out . Low level recording I always scared of
Reply
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Umer,

I didn't get the meaning of your word "ahhhhhhhhhhhhhhhhh".

Fyi, we are doing SAP Automation testing using QTP 9.5, in some cases in SAP we have to do some operations on windows objects such as Opening the files located in our pc, attaching a files from our pc to SAP system.

we were facing the object identification issues in doing the same, infact QTP was getting hanged & crashed when we tried to record or ADD the windows objects into Obj.Rep.

Fyi, with regard to the above issue, we raised a ticket with HP support & they came back with a couple of work arounds i.e low level recording & WSH methods and it worked fine for us.

Moreover, I was suggesting to try out the above work arounds and its upto you to try or not.

Hope I am making senseSmile
Reply
#10
Solved: 11 Years, 3 Months, 3 Weeks ago
FYI Wink dont screens in your project gets minmized or change location and low level recording scripts fails. Because low level recording can do a task but it is unpredictable in execution. Thats why I am trying to avoid it , may be its the last resort i'll have to do. Becuase if HP responded you in your ticked for low level recording what can we do but they are real bastards as FILE OPEN/SAVE are common features in an application
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,521 10-24-2015, 08:40 AM
Last Post: tigerliew
  Comapre txt file with different number of lines anushreebehura 0 1,745 06-02-2015, 06:28 PM
Last Post: anushreebehura
  How to read a text file using FSO from bottom to up order?? vallalarasu.p 0 2,509 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  How to find a file after downloading UFT_Newbie 1 2,973 09-18-2014, 08:43 PM
Last Post: UFT_Newbie
  how to create text file swayam 1 2,852 05-29-2014, 01:25 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 5 Guest(s)