Waitfortextpresent + store the result to a variable

Hi.

I’m using the function Waitfortextpresent. If I find the word “FINISHED” into a text, I want it to store it as the value of a variable called “Status”. If it does not find it, I want to store the value as “CONTINUE”.

How can I do it?

thanks!

{
      "Command": "waitForElementPresent",
      "Target": "",
      "Value": "Status",
      "Description": ""
    },
  {
      "Command": "executeScript",
      "Target": "if (${Status} != \"FINISHED\") \nStatus = \"CONTINUE\";\nelse\nStatus = ${Status};\n\nreturn Status;",
      "Value": "Status",
      "Description": ""
    }

Thank you for your help!

I got this error:

  • Executing: | waitForElementPresent | | Status |

  • [error]

Line 7: timeout reached when looking for element ‘’

  • [info]

Macro failed (Runtime 5.40s)

After this I’d need to run:

If Status is FINISHED, type “1”, otherwise type “2”

1 and 2 are placeholders for some text.

Thank you for your help.

you have to specify your xpath in line 1

{
      "Command": "storeText",
      "Target": "xpath=",
      "Value": "Status ",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var Text = (${Status} == \"FINISHED\")?1:2;\n\nreturn Text;\n\n",
      "Value": "TextToType",
      "Description": ""
    }

ok thanks!

I’m trying to automate chatgpt tho, so the xpath will always be different…I saw there is a similar request, not sure how to implement it.

I will prompt something into CHATGPT and I will ask it to write FINISH when it has finished.

So a couple of approaches:

  1. We manage to find the text “FINISHED” in the last parahraph generated and store it as a variable, then if found, proceed to step 2, or otherwise write “continue writing”

  2. We check the image and look for the text FINISHED (Not sure this is doable).

Moreover. I’d need to check when chatgpt is done writing so that I can then input the right command.

In case someone can help I’m willing to pay.

Thanks!

Please see message.
Please see message.

Hi.

I’ve shot a video so that you can understand the process better.

I’m sure it can all be automated, not sure if it is too complicated.

Please let me know, thank you

For the message, I see I have to select the xpath, however the xpath in chatgpt is always changing. When I prompt, it adds a div, when it answers, it adds another div. As explained in the linked message of a previous post about how to handle chatgpt. Unfortunately the xpath is not static.

I mean see personal message in forum

so what is you want is

type a question and wait for answer
then extract answer and type another question and repeat till last row of CSV?

Answered in details in PM. Thanks