Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raido Group - Select first in list
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hello,

Is there any way to have QTP select the first radio button?
There are 9 visable radio selections, I use a search string to bring the desired raido button to the top of the list. In this case it was ("7"). How can I get QTP to always select the first button after running a search string?

Example:
Code:
Browser("XXX").Dialog("Explorer User Prompt").WinEdit("Enter search string:").Set "George Washington"
Browser("XXX Landing").Page("XXX Landing").Frame("TargetContent").WebRadioGroup("SINGLE_SELECT_GRID$sels$0").Select "7"
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
Browser("XXX Landing").Page("XXX Landing").Frame("TargetContent").WebRadioGroup("SINGLE_SELECT_GRID$sels$0").Select #0
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
When I ran the script using Select #0, I get a Syntax error.

The test run cannot continue due to a syntax error.
Syntax error
Line (19):
Code:
"Browser("MSS Landing").Page("MSS Landing").Frame("TargetContent").WebRadioGroup("SINGLE_SELECT_GRID$sels$0").Select #0"

This is the code I am using is:

Code:
Browser("xxx").Page("xxx Landing").Frame("TargetContent").Link("Find").Click
Browser("xxx 2.0").Dialog("Explorer User Prompt").WinEdit("Enter search string:").Set "George Washington"
Browser("xxx").Dialog("Explorer User Prompt").WinButton("OK").Click
Browser("xxx Landing").Page("xxx Landing").Frame("TargetContent").WebRadioGroup("SINGLE_SELECT_GRID$sels$0").Select #0
Browser("xxx").Page("xxx Landing").Frame("TargetContent").WebButton("Continue").Click

Thank You,

-Scott
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Make sure to put #0 in quotes:

Code:
Browser("XXX Landing").Page("XXX Landing").Frame("TargetContent").WebRadioGroup("SINGLE_SELECT_GRID$sels$0").Select "#0"
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Thak You for the Syntax correction. The .Select "#0" worked.

I ran into another issue.
As long as I record entering the search word "George Washington", my script works.
As soon as I link to a data sheet or change the .Set value (example: "Betsy Ross") the lookup box is populated with correct text but, a "Search string not found" error is displayed.

Any ideas would be appreciated.

Example:
Code:
Browser("XXX").Dialog("Explorer User Prompt").WinEdit("Enter search string:").Set "George Washington"
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Scott,

Add wait 1 statement before and after your statement .

Thanks,





Reply
#7
Solved: 11 Years, 3 Months, 4 Weeks ago
That worked. Thank You!
Reply
#8
Solved: 11 Years, 3 Months, 4 Weeks ago
Wonderful. It's great to hear that it worked. Wait statements are very critical in application execution and debugging.

Have a great day!



UFTEnthusiast
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  select an item from a very long drop down list vijayendra.shukla 0 2,719 12-03-2013, 09:40 PM
Last Post: vijayendra.shukla
  Handling "Web Radio Group" in QTP 9.0 Abhishek 7 17,958 07-23-2009, 07:48 PM
Last Post: supputuri
  how to check data/list in dropdown list gurram 1 3,273 03-25-2008, 01:19 PM
Last Post: sreekanth chilam

Forum Jump:


Users browsing this thread: 1 Guest(s)