Using tests suite yaml fine

37 views
Skip to first unread message

Google Admin

unread,
Jun 16, 2016, 12:15:55 PM6/16/16
to testng-users
Hey,

I'm trying to use tests suite file with yaml format, but when I try to use array for parameters it gives an error "org.testng.TestNGException: org.yaml.snakeyaml.error.YAMLException: No suitable constructor with 2 arguments found for class java.lang.String"
This is the example ot the tests suite file:
name: Selenium poc
listeners:
  - utilities.Listener
tests:
  - name: Http status code test on homepage on chrome for mac
    parameters:
      pplatform: Platform.MAC
      pbrowser: chrome
      pversion: "50"
      pos: mac
      pdevice: desktop
      pwidth: 1280
      pheight: 800
      env: "rmstaging"
      base_urls: 
        - "stirng_1"
        - "string_2"
    classes:
      - tests.HttpStatusCodeTest

Can you give some solution to how use array in parameters?

Thanks,

Nikolay Atanasov

⇜Krishnan Mahadevan⇝

unread,
Jun 16, 2016, 11:08:55 PM6/16/16
to testng...@googlegroups.com
Nikolay
How would you pass parameters as arrays if you were doing in via the traditional XML approach in TestNG ?
I don't remember seeing that functionality. So I don't think you would be able to do it via Yaml as well. 
You might have to just accept values for this parameter as comma separated values and then split them internally in your code.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages