How can I get the required variable from my Java class and assign it as a parameter in my testng.xml
?
For example, this is the variable I want to get:
String chatTitle = driver.findElement (By.id ("title")).getText ();
I want to assign it as a parameter to my test suite:
<parameter name="chat-title" value="chatTitle variable value" />
Any advice?