How to call/submit Form from another page in custom module? I would like to set cron function in my custom module. I have created one form which is called with submit button from UI. Now I would like to submit/call that form from another page (.module file) where I have written my hook_cron function, how it would be possible?

In Drupal 7, I use 

$form_state['values'] = "";
drupal_form_submit('customfeedimport_main_pagecallback_submit', $form_state);


But I am new to Drupal 8, so how to perform this cron thing in Drupal 8?

Also what should be included in the namespace, use?
You can do it with the FormBuilder::submitForm() function.

To register a new user (taken from the docs):

// register a new user
$form_state = new FormState();
$values['name'] = 'robo-user';
$values['mail'] = 'robouser@example.com';
$values['pass']['pass1'] = 'password';
$values['pass']['pass2'] = 'password';
$values['op'] = t('Create new account');
$form_state-&gt;setValues($values);
\Drupal::formBuilder()-&gt;submitForm('user_register_form', $form_state);


You might have to include the namespace for the FormState class before this code if not done already.