Forum Discussion

oranjezhau's avatar
oranjezhau
New Contributor
4 years ago

faker or javafaker in open source soap ui project

Hello everybody, i'm trying to use the java library called "javafaker" but i don't inderstand how to import it.

I've put the javafaker jar in bin/ext directory and this is what i have in soapui log:

 

Fri Jun 25 13:55:33 CEST 2021:INFO:Adding [............................SoapUI-5.6.0\bin\ext\javafaker-1.0.2.jar] to extensions classpath

 

But after, i always an error like this when i'm trying to initialise my script:

 

import Faker

Faker faker = new Faker()
log.info faker.name().firstname()

 

Someone already use this library ?

Thank's a lot.

  • It works. But you have a trivial error in import. Please see below screen shot.

    BTW, there is dependency on snakeyaml library which needs to be downloaded and placed under SOAPUI_HOME/bin/ext; and restart the tool.

     

     

  • nmrao's avatar
    nmrao
    Champion Level 3

    It works. But you have a trivial error in import. Please see below screen shot.

    BTW, there is dependency on snakeyaml library which needs to be downloaded and placed under SOAPUI_HOME/bin/ext; and restart the tool.

     

     

    • oranjezhau's avatar
      oranjezhau
      New Contributor

      Hello man, thank's a lot. It's working great. My import wasn't good. Thank's all of you.

    • oranjezhau's avatar
      oranjezhau
      New Contributor

      This is work on java with correct import and capitalize the N in fullName():

       

      import com.github.javafaker.Faker;

      public class TestFaker {

      public static void main(String[] args) {
      Faker faker = new Faker();

      System.out.println(faker.name().fullName());

      }
      }