Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems in For loop
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi Ankur,

I am facing problem in the following scenario.
There are number of links named "remove" present in my application, I declared a descriptive object to find out total no. of links present since it is dynamic. Using For loop I am pointing those links using index value.When I tried to click on those links in script it's working but the alternative nos are going ( means it first clicked on Link1 then link3 then Link5....in this way). But Iwant to click in sequentially like first Link1 then Link2 then Link3...etc. The following is the code that I created:
-------------------------------------------------------------------
Code:
If  browser(obr).page(opg).link(company_edit).exist Then
browser(obr).page(opg).link(company_edit).click
End if
Dim remove_link
Set remove_link=description.Create
remove_link("micclass").value="Link"
remove_link("innerhtml").value="Remove"
remove_link("html id").value=".*companyRemoveBtn.*"
Set rm_link=browser(obr).page(opg).childobjects(remove_link)
cnt=rm_link.count

For i=0 to cnt-1
browser(obr).page(opg).link("html id:=.*companyRemoveBtn.*").click
Next

------------------------------------------------------------------

Here the link html ids are like companyRemoveBtn1,companyRemoveBtn2,companyRemoveBtn3 etc...so I have used RE.


Please reply my post asap...in my id jyotikmo@rsgsystems.com orjyoti.krushna@gmail.com

Thanks
Jyotikrushna
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi,
Can you try for this.

For i=0 to cnt-1
rm_link.item(i).click
Next


Regards
Deepak
Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
Try

browser(obr).page(opg).link(rm_link(i)).click

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 1,145 06-17-2019, 12:19 PM
Last Post: Treirk
  Problems with URL as Object identifier??? jcraig26 1 3,389 02-27-2013, 05:06 PM
Last Post: anil2u
  FOR LOOP shayk1985 1 5,352 12-13-2012, 11:35 AM
Last Post: sams001
  QTP recording problems Masa 2 2,465 11-11-2012, 08:28 AM
Last Post: Masa
  How to exit from a for loop silpavinod 2 9,938 10-17-2012, 12:55 AM
Last Post: agarwl.anurag

Forum Jump:


Users browsing this thread: 1 Guest(s)