Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Identifying radio buttons with same html ID but dynamic webelement properties
#7
Not Solved
Hi Manisha,

U can follow the below approach, its a generic approach and can handle the n number of question in n number of scenarios

1) Create a .xls file containg the questions and their respective answers.(attached is the .xls for refrence)
2) Load the .xls to ur global or local data table.
3) Count the number of questions in a given scenario(U can use DP), store it in a variable say vb_QuesCount
4) Start a for loop for the number of questions in a scenario
5) Using the GetRoProperty find the name of first element (name of 1st question since u are using DP it won't be a problem),vb_QuesText
6) Search through the 1st column of the datatable where .xls is loaded and check if question exists in datatable or not.
7) If question exists then get the answer value for that particular question from datatable say in variable vb_Ans
Code:
Code:
Set Dp=Description.Create()
Dp(xx).Value=??(create description for webRadioGroup)
Vb_quesCount=Dp.Count
For i=1 to vb_quesCount
vb_QuesText=Dp(i).GetRoProperty
‘Code to search the vb_QuesText in datasheet and if exists( This U can do it ur self)

Browser(x).Page(y).webRadioGroup (‘Name :=’&vb_QuesText,’html id:=Question[‘&i&’].Answer.Id’).Select vb_Ans
Next


Hope this helps u, let me know in case of any issues.

Regards,
Sankalp
Reply


Messages In This Thread
RE: Identifying radio buttons with same html ID but dynamic webelement properties - by sshukla12 - 04-24-2012, 06:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to identify a Dynamic WebElement? PreethiJoshi 1 5,211 05-03-2018, 04:08 PM
Last Post: Ankur
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,056 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira
  Radio Button vinod123 8 10,265 09-25-2014, 12:12 PM
Last Post: vinod123
  Radio Group problem vinod123 4 5,551 09-25-2014, 12:10 PM
Last Post: vinod123
  not identifying the object properties seven 3 2,648 02-18-2014, 04:23 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)