Thank you for the shared details.
The attachment you wanted to share was not successfully attached. Probably you should zip it t be able to send it.
Anyways, I reviewed the code you have used and I suppose that the text is generated but the text field causes troubles actually. You could use the following to ensure the text is generated.
This will right the text into the execution log
of the test. You could also include assert statements
after the find element statements to ensure these are actually located. You might need to include some delays so that the elements on page are located.
I hope these will be helpful for you to find out what is not working in your code. As per the errors listed in the log you would need to debug the implemented custom code and adjust it to the application under test.
Thank you for your understanding!