Skip to content
Get Free Trial

Write Scripts with AI

Give an AI assistant such as Claude, ChatGPT or Copilot the Sahi Script reference so it can write, explain and fix Sahi scripts.

AI assistants write better Sahi scripts when they can read Sahi’s own documentation instead of guessing. These docs are published in plain text for that purpose.

File What it contains Use it when
llms-sahi-script.txt Best practices, the language basics and every Sahi function in one file You want the assistant to write or review scripts. The file is large (about 1.8 MB), so attach it to an assistant that accepts large files, or give it only the pages you need.
llms.txt An index of all the documentation, with a link to each page The assistant can browse the web and should find pages on its own.
llms-full.txt The full text of all the documentation You also have questions about the Editor, settings or release notes.

Any page can also be read as plain text by adding .md to its address, for example /docs/sahi-script/functions/actions.md.

Tell the assistant what the test should do, step by step, and which application it runs against. For example:

Using the attached Sahi Script reference, write a Sahi script that logs in to
the demo shop with user "test", adds two copies of "Java" to the cart and
checks that the total is 1150. Follow the best practices in the reference.
  • Run the script in Sahi Pro before you rely on it. The assistant cannot see your application, so element names may need correcting.
  • Use the Controller to find the right accessor for an element, and give it to the assistant.
  • Ask the assistant to explain any function you do not recognise, then look it up in the Function Reference.