Micro Focus QTP (UFT) Forums

Full Version: At run time, object could not be found by QTP (WinListView)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Application Under Test (UAT) requires a file to be attached. When recording in QTP, the file selection from the Dialog Window is recorded and learned as a WinListView object. However, at run time, this object could not be found by QTP.
Please take a look at it and pass your suggestion on how to work on it.
Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").WebRadioGroup("adType").Select "CR"
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").WebFile("uploadfile").Click
Browser("Chronicle Careers").Dialog("Choose File to Upload").WinListView("SysListView32").Select "PDF_file1"
Browser("Chronicle Careers").Dialog("Choose File to Upload").WinButton("Open").Click
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Image("uploadfile_on").Click

Please see the attachment.
Thanks
-murali
Hi

Can you try once the selecting file option as:
Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").WebRadioGroup("adType").Select "CR"
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Window().Type "c:\path\filename.ppt"
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Image("uploadfile_on").Click
hi Kavita

Thanks for looking into it. I am basically a Business Analyst. Recently, working as QA. Thanks for helping me.

I have added the code which you provided and tried.

Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").WebRadioGroup("adType").Select "CR"

Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Window().Type "C:\Documents and Settings\mthota\My Documents\Murali\Office\Sprints\diff upload files\PDF_file1.pdf"

Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Image("uploadfile_on").Click

It selected the 1st radio button.
Code:
(WebRadioGroup("adType").Select "CR").

But it didn't open any window or it didn't load any file. It displays like this on my page.
Please see the attachment.
HI kavita,

Please take a look at the screen shot.

Thanks
-murali
Hi Kavita..
Can u plz explain what the diff b/w 1 & 2 i am new to QTP..
1)
Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").WebFile("uploadfile").Click
Murali uses this one.. then how do u think to resolve this..

2)
Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").Window().Type "C:\Documents and Settings\mthota\My Documents\Murali\Office\Sprints\diff upload files\PDF_file1.pdf"

what is Window().Type..

u r help would be appreciated..

Hi Murali,
Code:
Browser("Chronicle Careers").Page("The Chronicle Of Higher").Frame("Frame_7").WebFile("uploadfile").Click
here it doesn't treat "Browse" as Web Button plz check properties of "Browse" it may resolve u r prob..

Thanks
Hi
Murali, I thought your application allows user to type the file name in the browse edit box, thats why i adviced you to type the path and file name, as i am doing in my application.

Nandu, Difference between 2 is ,
In 1st option we are selecting the file from the location by clicking on Browse button.
In 2nd one we can select the file just typing the file name,instead of using browse option.

-------------------------------------------------------------------------------------------------
Hi again Murali,
Include below line(1) in your script before accessing the window objects...
1.
Code:
Set goShell=CreateObject("WScript.Shell")
If still error comes...
Then try by replacing:
Code:
Browser("Chronicle Careers").Dialog("Choose File to Upload").WinListView("SysListView32").Select "PDF_file1"
with below line:
Code:
Browser("Chronicle Careers").Dialog("Choose File to Upload").WinEdit("SysListView32").Set "PDF_file1"
Thanks Kavita and nandu for looking in to it.

I am totally lost. I am very new to this QTP. My team asked me to work on some scenarios. So learning. I can send the website url, login and passwords. Can you please work on your machine and let me know how this can be fixed.

I really appreciate your help. Please send me your personal email address, so that I can send the url, login and password.

Thanks
-murali
Hi Murali,

Why can't you take help of your colleagues, if the url, UID and PWD is confidential?
Hi kavita,

it is not at all any confidential. I am the only one using QTP in my office. So no one knows about it. Anyone go to our site and create their own account. I created one account. I just want to give that info. But I am not sure to post any password/username on this site is a good practice. So I asked your email id.

Please let me know.

Thanks
-murali