how to verify the count of same type web elements
I have two web elements which provides the pricetext and value from a string. The number of elements changes dynamically. How do i retreive the values.
For instance, string = "These are the values of Milk, Sugar, and the price is Price:20. These are the value of Milk, Sugar and the price is Price40 "
iPos = Instr(1, "string", "price:")
if iPos > 0 Then
use the Mid function
As of now i am retreive the pos of price and then using the Mid function to get the value. However i am able to retreive only 20,not 40. What type of loop can be used when retrieving the position of price string. Can someone please help? Thanks.
Re: how to verify the count of same type web elements
See if this helps
'Run a for loop through the entire length of the string
For n = 1 to Len(string)
pos = Instr(n,string,"Price")
If pos > 0 Then
Mid(string,pos,1) ' depending on your logic
n = pos + 5 (set this as per your next position of iteration)
pos variable will always hold the next position where price is found. Extracting the price values i.e. 20,40,60 you can use your already existing logic