Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
selecting values from the dropdown webelement
#1
Not Solved
Hi All,

I am automating the RTC 4.0.5 workitem creation using QTP.
Issue is now all the weblist is converted to the webelement.
I need a way to select a value from the dropdown of the webelement.

I tried with the small command to change the innertext of the attribute using :-

Code:
Set objWebElement    =    Browser("name:="&BrowserProperty).Page("title:="&BrowserProperty).WebElement("class:=ValueHolder ViewBorder","Index:=6")
        objWebElement.Object.innertext    =    attribute vale

But after saving the attribute value is not retained, then I tried using:-

Code:
Browser("name:="&BrowserProperty).Page("title:="&BrowserProperty).WebElement("innertext:=unassigned","Index:=21").click
    set wshShell = CreateObject("WScript.Shell")
    wait 5
    wshShell.SendKeys "{DOWN}"
    wshShell.SendKeys "{DOWN}"
    wshShell.SendKeys "{ENTER}"
    wshShell.SendKeys "{TAB}"

For first selection it is working, but if I want to change the selected value then it is not working.

I tried with the WebTable too but none helped.

Please suggest me solution ASAP.

Thanks,
Pooja
Reply
#2
Not Solved
How would you be able to select the right value if you use the sendkeys? For eg: If there are 10 values, and you want to select 5th value, you may want to do 5 times down but during runtime if the value has been changed then you wont get the desired value.

BTW, you mentioned about webtable? where is the webtable located?

Try this, Record the action and see the script generated? Does it generate a script?
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
#3
Not Solved
Thanks Basanth for replying, actually there is a WebTable object, inside which we have attribute at column1 and their respective values at column2.

Just FYI, at column2 we have a WebElement dropdown.

I figured out lots of different ways for object identification (as mentioned in the initial comments of the thread), but could not find the way for selection.

Even I agree with you about the SendKeys "{DOWN}" is not a good way for the huge list.

Please suggest me some solution.

Thanks,
Pooja
Reply
#4
Not Solved
Did the recording (low-level) work? did it generate any script?
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


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad How To Find Dropdown Object based on Values from the dropdown list mesg2anil 12 34,279 12-19-2017, 10:25 PM
Last Post: sandy2404
  how to select value from google search box dropdown +QTP prajyot 0 2,925 06-28-2017, 06:30 PM
Last Post: prajyot
  Searching for and selecting row in Datawindow zsl0009 0 2,839 08-04-2015, 01:02 AM
Last Post: zsl0009
  Problem selecting in a dropdown menu during playback. qemls29 9 13,161 07-28-2015, 05:44 PM
Last Post: Sharan
  Selecting Link Magad 1 2,853 11-07-2014, 03:56 AM
Last Post: PrateepKaraval

Forum Jump:


Users browsing this thread: 1 Guest(s)