0

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?

LexSav
  • 444
  • 1
  • 9
  • 19
  • you need to provide some dynamic xml generation mechanism. For example take a look at [this](https://stackoverflow.com/questions/49834457/dynamic-testng-xml-creation-getting-wrong-xml-where-i-am-wrong) – Vault23 Dec 23 '19 at 11:18
  • Is it not useful for you to use a data-provider for this? – Rodrigo Vaamonde Dec 23 '19 at 13:49

0 Answers0