Micro Focus QTP (UFT) Forums
Add new lines - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Add new lines (/Thread-Add-new-lines)

Pages: 1 2


RE: Add new lines - eroshan - 09-15-2009

Hi

I think i did what you mention. you can see it on snapshot (this time i attached it)

but i have no idea how should i change Test object details according to the new WinEdit. Can you help me for that ?

(The error is same still)

Thanks


RE: Add new lines - Saket - 09-15-2009

How did you added the objects.
I doubt the heirarchy is not proper, I have never seen one dialog under a dialog.
also, I cant see the naiveclass property for FileName, are you able to highlight the control in your application?
Can you check if the below statement works?
Code:
Dialog("File Download").Dialog("Save As").WinButton("Save").Click

if No then please try again adding object into OR. I beleive the 'Save As' dialog should be different Node.
Ex: Refer Snap of OR and the code should be like

Code:
Dialog("File Download").WinButton("Save").Click
Dialog("Save As").WinEdit("FileName").Set "C:\"
Dialog("Save As").WinButton("Save").Click
let me know how it goes.


RE: Add new lines - eroshan - 09-15-2009

yes Saket you mentioned line is perfectly working without this

Code:
Dialog("Save As").WinEdit("FileName").Set "C:\"

can you guide me to set OR properties for new WinEdit object ?

the error is
[color]Cannot identify the object "FileName" (of class WinEdit). Verify that this object's properties match an object currently displayed in your application.[/color]


RE: Add new lines - Saket - 09-15-2009

I am not getting you, which line is perfectly working?
Code:
Dialog("File Download").Dialog("Save As").WinButton("Save").Click

or

Dialog("Save As").WinEdit("FileName").Set "C:\"

Have you tried adding the object again?


RE: Add new lines - eroshan - 09-15-2009

Hi saket
This line is working
Code:
Dialog("File Download").Dialog("Save As").WinButton("Save").Click
This line is not working
Code:
Dialog("Save As").WinEdit("FileName").Set "C:\"


I think error is in the OR property of the WinEdit object , is't it?


RE: Add new lines - Saket - 09-15-2009

Yes I think so, delete the object from OR and add it again.
does your save as dialog is same as in snap below? I guess Yes, then add the highlighted object.

It should work now.


RE: Add new lines - neetika - 09-17-2010

Hello Saket

I am getting this error msg when i m trying to set the filepath+filename in code to download an excel file.

The operation cannot be performed

Line (281): "Dialog("text:=File Download").Dialog("text:=Save As").WinEdit("text:=File &name:").Set FilePath & FileName".

Here is the lines of code which is giving above error :

Dialog("text:=File Download").Dialog("text:=Save As").WinEdit("text:=File &name:").Set "F:\temp.xls"


Please suggest wht could be the problem!
Regards
Neetika


RE: Add new lines - Saket - 09-17-2010

Hi Neetika, always create a new thread for the new query instead diverting athread.
for answer to your question - WinEdit("text:=File &name:"). in your statement is causing the issue. by default qtp treats all program description as regular expression. and so it does the same for File &Name. there could be two solutions for this 1. use regular expression like text:=File \&name:" 2. use description.create and put value as "File &Name"

dont use text to identify a winedit object instead use nativeclass/class and index.