Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to set value for a drop down box
#1
Not Solved
Hi,

I am having a drop down box in my frontend, whose value I need to change.
I have successfully added the drop down box to my repository but I am unable to figure out how to change the value.
I am using the below code
Code:
Browser("Time File").Page("Time File: Alexander Adams_3").Frame("contentFrame").SAMEdit.SetProperty Text,"Year"


But I get the following error :
Invalid procedure call or argument
Line (95): "Browser("Time File").Page("Time File: Alexander Adams_3").Frame("contentFrame").SAPEdit.SetProperty Text,"Year""

I guess I am not setting the property correctly .
Can someone suggest me how to do it
I have attached a snapshot of the drop down box whose value I wish to change.
Thanks ,
A Beginner


Attached Files Image(s)
   
Reply
#2
Not Solved
Hi Rookie,

I could not under stand why you are using "SAMEdit.SetProperty Text,"Year""?

Any how you can select the 'Year' from list box by just using :"Select" method on the list box.

Let me know if you need any info.

Thanks,
QTPKing.
Reply
#3
Not Solved
Hi ,

Thanks for your input. I tried using "Select" method on the object SAMEdit.
The codeline was "SAMEdit. Select("Year")
However, I get an error which states that
The method is not defined on this object.
Even in intellisense on SAMEdit object, I donot get to see the Select method.I get SetProperty and that is the reason why I used that method.
Kindly advise.
Rookie
Reply
#4
Not Solved
Hi,

Please try Weblist("SAMEdit").Select "YEAR". It may be help you, I guess..

Thanks,

Code:
Browser("Time File").Page("Time File: Alexander Adams_3").Frame("contentFrame").Weblist("SAMEdit").Select "Year"
Reply
#5
Not Solved Exclamation 
We have a simular problem. We are using the record options as we build our automated scripts, and recording the response from the drop-down entries. However, when runing the automated script, it will stop at the Drop-down. If I am using the Run in maintenance mode, I can select the drop-down and then it will accept the entry, and complete the block, and stop at the next drop-down. Once I have done this for the entire repository object. it looks identical to what was originally in the Script. Unfortunately, when I again run the Script with the new changed script it does exactly the same thing stoping at the drop-down stating it can not proceed. It would appear that the Drop-down structure is not recoginzed. In one case I actually used the Set statement to enter the data into the space rather than using the drop-doen, but even this has had limited success since it can not wotk when a drop-down includes s second level dropdown selection. Any Idea how I can get around this problem?Sad
Reply
#6
Not Solved
Something which has me perplexed,

The code states SAMEdit, The error message states SAPEdit?

typo?

Would be helpful if you can paste the code?

Wondering if the list is the issue, then you can try to remove the list object from the repository, highlight it in the application and make sure it does highlight. Rename the object, and code that line for the list.

Else,
Try the descriptive approach. Just for the list spy the properties and put them across and see if the select works.

This is just a trial, there could be numerous reasons why this isint working. Could be the application layer, technolgical issues, select in itself could have a issue..magnitude just grows !!

Well..God did not invent QTP Smile so never mind, try the above and lets see if we can plough far enough.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#7
Not Solved
https://www.learnqtp.com/forums/Thread-N...p-down-box

Code:
'Updated by test maintenance run
'Updated by test maintenance run
' "Delete Assessment" is one of several selection choices in the dripdown Box. It does not register when you click to execute, QTP stops, Using the Maintenance option just made it worse. In this script we are selecting to delete three records created using the dropdown option , with "delete" confirmation, and returning to View All Tasks to select next record.
'
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").WebElement("Delete Assessment").Click
'Browser("Home - Protection Database_2").Page("Home - Protection Database_3").WbfGrid("ctl00_ctl13_g_3dbb10b0_eb3b_425a_8e1c_37b4a58c9ca6_ctl00_ctl00_GridViewTasks_gridView_ctl02_ctl00_t").ClickCell
'Browser("Home - Protection Database_2").Page("Home - Protection Database_3").WbfGrid("ctl00_ctl13_g_3dbb10b0_eb3b_425a_8e1c_37b4a58c9ca6_ctl00_ctl00_GridViewTasks_gridView_ctl02_ctl00_t").ClickCell
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Delete").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Close").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_5").Link("View All Tasks").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").WebElement("Delete Assessment").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Delete").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Close").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_5").Link("View All Tasks").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").WebElement("Delete Assessment").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Delete").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_4").WebButton("Close").Click
Browser("Home - Protection Database_2").Page("Home - Protection Database_5").Link("View All Tasks").Click
'
'Wait(3)
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").Link("Home").Click
'
Wait(3)
Browser("Home - Protection Database_2").Page("Home - Protection Database_2").Link("View All Tasks").Click
Wait(3)
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").Link("My Tasks").Click
Wait(3)
Browser("Home - Protection Database_2").Page("Home - Protection Database_3").Link("View All Tasks").Click
Wait(3)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Not able to set value in application web edit box tanuj dewangan 4 3,701 07-29-2016, 03:58 PM
Last Post: harshadevadas
  Drag and drop issue excellentpawan123 0 2,746 01-13-2015, 05:04 PM
Last Post: excellentpawan123
  Drop down list class is a link thotamurali 2 4,195 08-22-2014, 05:48 PM
Last Post: thotamurali
  Selecting values from drop down using QTP. prempujaripati 2 46,768 06-26-2014, 06:06 PM
Last Post: rasmirani
  issue in drag and drop excellentpawan123 0 2,332 05-15-2014, 04:36 PM
Last Post: excellentpawan123

Forum Jump:


Users browsing this thread: 1 Guest(s)