QTP Forums

Full Version: Randomly changing numbers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a web table which contains links in the form of numbers like 1-179720143. I want QTP to always select the first link in the table but the problem is the number keeps changing randomly during every test iteration. For example, the first row number link 1-179720143 in the web table keeps changing to a different one and QTP doesn't recognize that different number in the first row. But I want QTP to always select the first row link in the table no matter whatever number it is. How do I make this happen? Any ideas? Thanks
This is the line that needs to be changed:
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("1-179320062").Click
you must identify the link through other properties, using object spy, and modify code as:

Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("property1:=value1", "propertyN:=valueN").Click

[your chosen properties must not change during iterations]
you can specify like

Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("1-\d*").Click
If there's only one link in the tablecell, use the .ChildItem on the table, like:

Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Table("TableName").ChildItem(intRowNum, intColumnNum, "Link", 0).Click
Hi ,

Just go with the above way given by Marc. it would work fine.

Example :
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Table("TableName").ChildItem(1, 1, "Link", 0).Click
Reference URL's