Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomly changing numbers
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
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]
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
you can specify like

Code:
Browser("Imperial Oil Limited").Page("Imperial Oil Limited").Frame("_sweview_3").Link("1-\d*").Click
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What exactly I should do in QTP when questions Randomly changes. QA Analyst 1 2,474 04-13-2012, 10:24 AM
Last Post: sshukla12
  Changing window titles smohile 2 2,995 10-21-2009, 09:21 PM
Last Post: qatestbrian

Forum Jump:


Users browsing this thread: 2 Guest(s)