Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DOM: Set value - INPUT element of type file
#1
Not Solved
Hi,

I am trying to set a value to an INPUT element of type=file, but it fails as its a read only property.
ele.value = "C:\abc.xml"
Note:- ele is the element I read using DOM Methods..

Using QTP "WebFile" method "Set", am able to set this value.
How is this designed!
____
Below is the line from page source of a web page:-
Code:
<input id="uploadFile" type="file" name='uiBean.evt.fullPath' value="" size="70" />

Using DOM I read this element & stored in a variable named ele.
ele.value = "C:\abc.txt"

This Fails!

But I am able to populate from QTP as below simple as below:-
Code:
Browser("dddd").Page("sddd").WebFile("UploadFile").Set "C:\abc.txt"

Now:-
I wanna populate this field using DOM or any other Object Model but not using QTP given WebFile/WebEdit Methods.

This should be possible in someway because QTP WebFile Method "Set" is also developed based on some library.

Note:-
value property of this element(INPUT Tag with type=file) is read-only. (http://www.w3schools.com/htmldom/dom_obj_fileupload.asp)


Can anyone please help me to resolve this issue.
For now I am managing with sendkeys method, which I want to remove.

Thanks,
Bapu
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Is there a way to create dynamic objects by declaring the type of object as parameter lotos 3 2,236 11-08-2017, 11:15 PM
Last Post: lotos
  Unable to select WebFile element upadhyay40 5 7,991 06-28-2016, 04:38 PM
Last Post: aakash
  QTP identifying WebList as WebEdit and an Element passion77 3 8,461 01-27-2014, 10:21 PM
Last Post: supputuri
  Keyboard input in script Anurag Tygai 1 2,793 12-24-2013, 06:03 PM
Last Post: sshukla12
Sad QTP Script | how to get object of some open window just using its class type,Java sophia.sabir 1 8,900 08-07-2013, 01:26 PM
Last Post: anil2u

Forum Jump:


Users browsing this thread: 1 Guest(s)