Micro Focus QTP (UFT) Forums
How to parameterize WebRadioGroup - 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: How to parameterize WebRadioGroup (/Thread-How-to-parameterize-WebRadioGroup)

Pages: 1 2


How to parameterize WebRadioGroup - upadhyay40 - 11-19-2009

Hello All,

i have a code where i need to be parameterize webradiogroup, please find the attached script
Code:
Browser("xxx").Page("xxx").WebRadioGroup("optBanner1").Select "N"
so can you please let me know how i can achieved this, hoping for cooperation.

Thanks

Mahesh


RE: How to parameterize WebRadioGroup - Saket - 11-19-2009

Create a column in your datatable say - Group
and set in your statement as
Code:
Browser("xxx").Page("xxx").WebRadioGroup("optBanner1").Select Datatable("Group",dtLocalSheet)

Is this what you are looking for?


RE: How to parameterize WebRadioGroup - upadhyay40 - 11-19-2009

Hi saket,

Thanks for your help saket, but can you please tell me actually for every WebRadioGroup my optBanner1 then optBanner2 & optBanner1 so forth, so is this a right solution for it.

Thanks
Mahesh


RE: How to parameterize WebRadioGroup - Saket - 11-19-2009

Sorry Mahesh, but I am not getting what exactly you are trying to do, if you can explain the scenario a bit, it will help.


RE: How to parameterize WebRadioGroup - upadhyay40 - 11-19-2009

hi,
Actually in my webradiogroup i have three values like, so every time i need to select only one,
Code:
Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "Y"
Browser("xxx").Page("xxx").WebRadioGroup("optBanner1").Select "N"
Browser("xxx").Page("xxx").WebRadioGroup("optBanner2").Select "X"

so for that purpose i need to do parametrization that every time it login with same user and picked up another value so it iterate for 3 time for 3 radio option, now how can i achieve this, please let me know, if you need some more clarification from my end , please let meknow

Thanks
Mahesh


RE: How to parameterize WebRadioGroup - Saket - 11-19-2009

try this
Code:
Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#0"
Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#1"
Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#2"



RE: How to parameterize WebRadioGroup - v_selvam - 11-19-2009

Try this code
Code:
strValue = Datatable("Group",dtLocalSheet)
If strValue = "option1" Then
   Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#0"
ElseIf strValue = "option2" then
   Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#1"
ElseIf strValue = "option2" then
   Browser("xxx").Page("xxx").WebRadioGroup("optBanner").Select "#2"
End If



RE: How to parameterize WebRadioGroup - upadhyay40 - 11-19-2009

Hi v_selvam,

Thanks for your code but every time it logout after taking 1st value

Code:
Dim strValue,NumberOfLogo


Set checkLogoDesc = Description.Create()
    checkLogoDesc("micclass").Value = "WebRadioGroup"


'Retrieve all WebEdit objects in this page
Set logoOptionCollection = Browser("Publish").Page("Publish").ChildObjects(checkLogoDesc)

NumberOfLogo = logoOptionCollection.Count
MsgBox(NumberOfLogo)


strValue = Datatable("Group",dtLocalSheet)
If strValue = "optBanner1" Then
Browser("Publish").Page("Publish").WebRadioGroup("optBanner1").Select "N"
ElseIf strValue = "optBanner2" then
Browser("Publish").Page("Publish").WebRadioGroup("optBanner2").Select "X"
ElseIf strValue = "optBanner" then
Browser("Publish").Page("Publish").WebRadioGroup("optBanner").Select "Y"
End If


actually i want that every time it login and select next value from datatable.
Even i am not able to parameterize webradiogroup.
please help me out

Thanks
mahesh


RE: How to parameterize WebRadioGroup - Saket - 11-20-2009

there could be two ways
1. every time after login, set the datatable column with the new value and then execute rest of your code
2. Put all the options in rows of your datatable and loop through the rowcount

@Everyone - always wrap your codes with proper tags to make it more readable.like
Code:
[code]
...
your code
...
[/code]
refer help for more details.


RE: How to parameterize WebRadioGroup - upadhyay40 - 11-21-2009

Hi saket

Can you please give me little bit more explainations, or code by which i can acheive this, hoping for cooperation

Thanks

Mahesh
Hi saket,

You mean to say can i parameterize my UserID also to every time login once gain or without doing that i can acheive my post.
please let me know

Thanks
Mahesh