Skip to content

Check web pages behavior with multimodal LLM using kibernikto and playwright

Notifications You must be signed in to change notification settings

solovieff/kibernikto-playwright

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kibernikto-playwright

Use to basic test your web pages with OpenAI browser control.
Demonstrating kibernikto+playwright.

What it basically does:

  • Goes to yr page and looks what can be clicked.
  • Generates click options objects for the page with proactive expectations for element clicks.
  • Performs the actual clicks and checks what happens.
  • Compares the expectations and reality.
  • Prints and saves the results in the following form.
{
  "action_description": "The filter successfully applied, displaying only high ",
  "rating companies without changing the URL.",
  "expected_behaviour": "Filters companies by high rating",
  "actual_behaviour": "The list of companies was filtered to show only those with high ratings",
  "click_count": 1,
  "description": "High rating companies filter",
  "exact_element_text": "High rating",
  "new_url": "None",
  "status": "Success",
  "x": 100,
  "y": 800
}

Set up the env:

OPENAI_API_KEY=sk-svcacct-blahblahblah
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_API_MODEL=gpt-4o

Update main.py:

Change the url to yr site url

asyncio.run(test_website(web_link="https://example.com/"))

Or run as a console chat

asyncio.run(run_cmd_chat())

Run code

(assuming you set the environment yrself)

  • Install the requirements
    pip install -r requirements.txt
  • Install needed playwright stuff playwright install
  • Run main.py file using the environment provided.

About

Check web pages behavior with multimodal LLM using kibernikto and playwright

Topics

Resources

Stars

Watchers

Forks

Languages