Micro Focus QTP (UFT) Forums
Randomly changing numbers - 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: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Randomly changing numbers (/Thread-Randomly-changing-numbers)



Randomly changing numbers - mahadevan.swamy - 10-23-2008

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


RE: Randomly changing numbers - mahadevan.swamy - 10-23-2008

This is the line that needs to be changed:
Code:
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("1-179320062").Click



RE: Randomly changing numbers - stevol - 10-23-2008

you must identify the link through other properties, using object spy, and modify code as:

Code:
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]


RE: Randomly changing numbers - surya_7mar - 11-29-2008

you can specify like

Code:
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("1-\d*").Click



RE: Randomly changing numbers - Marc - 03-29-2009

If there's only one link in the tablecell, use the .ChildItem on the table, like:

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



RE: Randomly changing numbers - sreekanth chilam - 03-29-2009

Hi ,

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

Example :
Code:
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Table("TableName").ChildItem(1, 1, "Link", 0).Click