Is there a SIDE equivalent of "wait for text"? (SIDE = Selenium IDE)

I want to wait until xpath=//h2 is We are good to go!

This is how I would do it using Selenium IDE:

I wish I could do it like this

[Markup : crossed out title]

JavaScript?

I'm assuming that I may be able to achieve it (in KM) with Front Browser Control and a Javacript box?

You probably want an "efficient" solution. But if an inefficient solution is acceptable, at least until someone gets you a better solution, you could do this. It seems to work for me.

image

Even if you can find an efficient solution, it's still going to be in an infinite loop, because there is no trigger for this type of thing. The only way to tell how efficient something is is to measure it.

Even though the above code could be reduced to a single "pause until" action, I find that it's much better to do it with two actions, as I did above.

1 Like

Now that is interesting! I find it useful to learn new strategies. I didn't even know live OCR was possible!

Could you possibly make that downloadable? or I can recreate it in about two mins.

My mind is kind of blown that this is even possible! I wonder how slow/fast it is.

Thank you!

How do you get Apple Text Recognition? All I get is Languages - English

Hmm

Screenshot 2024-08-24 at 15.05.04

I'm using Brave Browser.

It fails. I wonder what I am doing wrong.

I'm glad you are happy. Some people react negatively, like, "But I don't want to use a lot of CPU power to solve my problem."

Let me google for you how to download that language. I thought it was built-in. Of course, if you are using a three year old version of macOS, you may not be able to access that language option. How old is your Mac?

As I said, determining how fast it is requires measuring it on your Mac. There are different ways to measure speed. In your case - once you get it working - I recommend that you open the Activity Monitor app, switch to the CPU page, sort the processes by %CPU, and see how busy your Mac is when that action is running and not finding the string.

In my opinion, since your action is (I'm guessing) probably only going to run for a few seconds, it really doesn't matter if my solution is heavy CPU or not. If your action is likely to run for several minutes or hours, then we may want to worry about CPU performance. But as a quick and dirty solution, it shouldn't matter.

I never tested OCR on Brave Browser. I think it should work. The error may occur when the OCR software doesn't see ANY text. That might be the problem, but let's solve your language selection problem before we address the Brave issue. The first step is to tell us whether your Mac is Intel or M series, and what OS you are using.

As best as I can tell, as long as you have macOS 12.0 or higher, plus KM 10 or higher, the option for "Apple Text Recognition" should be available, I think, but the first time I tried to access it I also didn't spot it because it isn't below the word "Languages" in the list. It actually appears in the options above the word "Languages" which is easy to miss. I suggest you check again. It might be there.

You'll need to write your own JavaScript (my knowledge of such is limited to Google results and random poking!), but if you look at the Conditions available to "Pause Until" you'll find a "Script Condition" with the option to run JavaScript in the front browser's front window:

image

So to pause until the front window of your browser is on a Forum page:

image

Your answers are so good, Nige, I still wonder if you are the Architect using a Nom de Plume.