frappe.click_button('Submit')

These function are clicking the button [Submit] but whats the different between
frappe.tests.click_button('Submit');
and
frappe.click_button('Submit');?

Hi @SinChan4896 ,

About , frappe.tests.click_button('Submit'):

  • This function, click_button, is part of the Frappe test framework and is specifically designed for writing tests and simulating button clicks within test scenarios.
  • It is used to programmatically click a button with the given label or name in the context of testing.
  • It is primarily used within test scripts and should not be used in regular application code or non-test scenarios.

About, frappe.click_button('Submit'):

  • This function, click_button, is part of the Frappe client-side JavaScript API and is meant to be used in the context of Frappe application development.
  • It is used to trigger the click event of a button with the given label or name within the user interface of a Frappe application.
  • It can be used in various client-side scripts or customizations to perform actions or trigger events associated with a specific button.

Hope this will help you out.

Thank you.

both of these don’t exist afaik.

You can use something like Cypress for UI testing.

Hi @ankush, I tried Cypress before, but there is so many error while setup. I found same problem on Github I faced, but there is no any solution to fix. That’s why it forced me to switch back to Test Runner for the UI Testing.

I am using v12.