Micro Focus QTP (UFT) Forums
Problem selecting in a dropdown menu during playback. - 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: Problem selecting in a dropdown menu during playback. (/Thread-Problem-selecting-in-a-dropdown-menu-during-playback)



Problem selecting in a dropdown menu during playback. - qemls29 - 11-24-2011

I have a problem selecting a value for a dropdown menu during playback. I'm getting the error: "Object is disabled". During playback, the dropdown menu responds to a Click with the code:
Code:
Browser( "Browser" ).Page( "Page" ).WebEdit("default value:=ABC").Click
But, can't select a value with the code:
Code:
Browser( "Browser" ).Page( "Page" ).WebEdit("default value:=ABC").Set "XYZ"
Listed below are the object's properties. Anyone know how to correct this problem? Thanks!

Code:
Class Name = WebEdit
abs_x = -358
abs_y = 577
class = rcbInput
default value = Full iLearnNYC Class
disabled = 0
height = 18
html id = ctl00_ctl00_cpMainBody_childCPMainBody_radCourseDeliveryType_Input
html tag = INPUT
innerhtml =     
innertext =     
kind = singleline
max length = 2147483647
name = ctl00$ctl00$cpMainBody$childCPMainBody$radCourseDeliveryType
outerhtml = <INPUT style="DISPLAY: block"
id=ctl00_ctl00_cpMainBody_childCPMainBody_radCourseDeliveryType_Input class=rcbInput
title="Please select term" value="Full iLearnNYC Class" readOnly type=text
name=ctl00$ctl00$cpMainBody$childCPMainBody$radCourseDeliveryType
autocomplete="off" jQuery152023392217578324192="3">
outertext =     
readonly = 1
rows = 0
type = text
value = Full iLearnNYC Class
visible = TRUE
width = 143
width in characters = 20
x = 690
y = 233



RE: Problem selecting in a dropdown menu during playback. - krr - 11-24-2011

Is it WebEdit or Menu?


RE: Problem selecting in a dropdown menu during playback. - ravi.gajul - 11-24-2011

Try this,
Code:
Browser( "Browser" ).Page( "Page" ).WebEdit("html id := ctl00_ctl00_cpMainBody_childCPMainBody_radCourseDeliveryType_Input
").Set "XYZ"



RE: Problem selecting in a dropdown menu during playback. - qemls29 - 11-24-2011

It's a drop down menu, which records and Object Spy sees as WebEdit. Thanks.


RE: Problem selecting in a dropdown menu during playback. - qemls29 - 11-28-2011

I tried using the html id, but still get the error "Object is disabled". Thanks.


RE: Problem selecting in a dropdown menu during playback. - vIns - 11-29-2011

Hi...
Object Spy clearly shows that the object is readonly. So, you will get 'Object is disabled' error.

If u want to change the readonly property to editable field, you can use below code.

Code:
Browser("Browser").Page("Page").WebEdit("WebEdit").Object.readOnly=false
'it makes it editable field
Code:
Browser("Browser").Page("Page").WebEdit("WebEdit").Set "vins"
' now you can set the value u want

Can u attach the screen shot of the page if it does not work?


RE: Problem selecting in a dropdown menu during playback. - kotaramamohana - 11-29-2011

Hi Friends,
I am also getting same problem in my application. QTP is setting value in the Edit box. But could not able to select correct option from drop down. It meas drop down list is not displaying while doing with QTP. If we are trying manually then list is getting displayed.

Here is the properties for WebEdit object
Code:
"Class Name:=WebEdit",
"abs_x:=431",
"abs_y:=316",
"class:=ui-autocomplete-input autocomplete-found",
"default value:=",
"disabled:=0",
"height:=26",
"html id:=org_picker_kw",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"kind:=singleline",
"max length:=2147483647",
"name:=org_picker_kw",
"outerhtml:=<INPUT aria-haspopup=true style=""WIDTH: 320px; FLOAT: left"" id=org_picker_kw class=""ui-autocomplete-input autocomplete-found"" role=textbox value=""Alliance Community Fund"" type=text name=org_picker_kw autocomplete=""off"" aria-autocomplete=""list"" madeSelection=""true"" open=""true"" jQuery162087509997674758=""5"">",
"outertext:=",
"readonly:=0",
"rows:=0",
"type:=text",
"value:=",
"visible:=True",
"width:=330",
"width in characters:=20",
"x:=431",
"y:=146"

I have attached screen shot of my application. Can you please share your thoughts


RE: Problem selecting in a dropdown menu during playback. - qemls29 - 11-29-2011

It works like a charm. Thanks!


RE: Problem selecting in a dropdown menu during playback. - shirly - 05-22-2015

Can you provide me the script, how did you resolve this?


RE: Problem selecting in a dropdown menu during playback. - Sharan - 07-28-2015

Hi qemls29,
I'm facing same issue, How did you got it working?

In my application, I've WebEdit object called 'time_zone'
Manually: If I type India, I get it in the drop down(already highlighed), Then press ENTER.

I'm unable to do same thing in UFT. Any suggestion would help.
I tried SendKeys and FireEvent but didn't work.

-Sharan