Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Sync on string or inStr
#1
Solved: 10 Years, 9 Months, 1 Week ago Smile 
If I am doing a Sync point, and am looking for the outer text but only a part of the text string; Do I just place that part in double-quotes?

As in the string “Current Account: 26678625-DAVIS CHARLES M”, I only want to sync on 26678625 before the script continues.

Do I:
Code:
Browser("WisdomLogin").Page("Wisdom DEV_3").WebElement("Current Household:  None").WaitProperty "outertext", "26678625”, 5000

Or must I add a wild card?

Code:
Browser("WisdomLogin").Page("Wisdom DEV_3").WebElement("Current Household:  None").WaitProperty "outertext", "*26678625*”, 5000

Or how do I use inStr?

Lorena ;-)
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
Hi Lorena,

You just need to modify your 2nd line code as

Code:
Browser("WisdomLogin").Page("Wisdom DEV_3").WebElement("Current Household: None").WaitProperty "outertext", ".*26678625.*”, 5000

But 1 question here, is 26678625 always fixed or any number may come as a part of the outertext? If its dynamic then you need to regularize the number as well according to the specification like digit count in the number.

Let me know if you have any doubts.
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
Yes, the number itself will change a it will be needed to compare to others. What do you mean "to regularize the number as well according to the specification like digit count in the number." thx

Lor
Reply
#4
Solved: 10 Years, 9 Months, 1 Week ago
if number of occurance are fixed then use [0-9]. if 3 numbers are there than use [0-9][0-9][0-9] times.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Cross Browser Sync Not Working geodude 0 1,858 04-07-2017, 08:43 AM
Last Post: geodude
  How to use sync function 22sumit 2 3,213 06-16-2015, 06:27 PM
Last Post: 22sumit
  Replace a string in a word document with another string rekha.naik 8 15,022 11-14-2013, 12:58 PM
Last Post: pranikgarg
Wink Webedit Javascript sync issue praveenzack 3 3,087 10-10-2012, 06:25 PM
Last Post: praveenzack
  .Sync is NOT waiting for browser to complete current navigation.. can anyone help? mansis 4 4,300 09-14-2012, 06:53 PM
Last Post: mansis

Forum Jump:


Users browsing this thread: 1 Guest(s)