Micro Focus QTP (UFT) Forums
Unable to select WebFile element - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to select WebFile element (/Thread-Unable-to-select-WebFile-element)



Unable to select WebFile element - upadhyay40 - 11-26-2009

Dear All,

When i try to take spy for Browse button it select whole text of logofilename & browse button together, i am unable to take spy for separate Browse button. I write descriptive programming for click on Browse button but i am unsuccessfull, Can anybosy just let me know how would i click on Browse so it open a window to select(Browse) file.

My code is:

Code:
Public Function ClickBrowseWebFile()

Dim NumberOfEdits, webElementToSearch
webElementToSearch="bannerlogo"
Set oDesc = Description.Create
oDesc("html tag").Value = "INPUT"
oDesc("micclass").Value = "WebFile"
oDesc("name").Value = "bannerlogo"

Set EditCollection = Browser("title:=Publish").Page("title:=Publish.*").ChildObjects(oDesc)

NumberOfEdits = EditCollection.Count
MsgBox(NumberOfEdits)

For i = 0 To NumberOfEdits - 1
    If EditCollection(i).GetROProperty("name") = webElementToSearch Then
      EditCollection(i).Click
    End If

Next

End Function

Please help me out, hoping for cooperation

Thanks

Mahesh
Hello All,

I got the solution,need for 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 Smile


Thanks

Mahesh


RE: Unable to select WebFile element - venkatbatchu - 11-29-2009

Hi,
In this situation "Logo File Name" is acting as Edit field so automatically whatever the file name u specified which is using that and pefroming the action this is the default behavior of these kind of Browse buttions

Regards,
Venkat.Batchu


RE: Unable to select WebFile element - upadhyay40 - 12-03-2009

Hello Venkat/All,

I got the solution,need for 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


RE: Unable to select WebFile element - MahalakshmiDevi - 12-04-2009

Instead of clicking on browse button you can specify the file path to be selected
Code:
Browser("XXX").Page("XXX").WebFile("Filebrowser").Set "c:\a1.txt"
The file would get set to the fileld


RE: Unable to select WebFile element - aakash - 06-28-2016

(12-03-2009, 09:34 AM)upadhyay40 Wrote: Hello Venkat/All,

I got the solution,need for 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

I've also done this setting in UFT_12.02, but even I got same problem.
Please help.



RE: Unable to select WebFile element - aakash - 06-28-2016

I've also done this setting in UFT_12.02, but even I got same problem.
Please help.