Dynamic button in a Web Table

When doing a search, the search result page list some rows which contain a column of button. How to click on (dynamic) button in a web table?

Questions by learqtptesting

Showing Answers 1 - 2 of 2 Answers

akothuru

  • Dec 11th, 2008
 

Use the below code to click access webtable childobjects

Code:
Set obj  = Browser("browser123").Page("page123").WebTable("table123").ChildItem(rownumber, colnumber, "WebButton", 0)
obj.Click

In "ChildItem(rownumber, colnumber, "WebButton", 0)", 0 represents the index of the dynamic webbutton. By default its index value is 0, if the webtable cell contains more than one button, you have to take care of index. 
Fisrt button in webtable cell get the index value as 0
Second  button get the index value as 1 an so on....

  Was this answer useful?  Yes

priyankvyas

  • May 11th, 2009
 

Hi this is Priyank,

To click a button on page dynamically use following code-

dim val
set my_button = Description.create ()
my_button("html tag").value = "A"
  ' check through object spy
my_button("text").value= val   'test1 is the text on button that you want to click

browser("sample").Page("sample").webbutton(my_button).click

To make this code dynamically you just need to update the value of variable "val" and respective button will be clicked.

To get the value in val use getcelldata(row,col)  method

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions