Ask a Question

faker or javafaker in open source soap ui project

SOLVED
oranjezhau
New Contributor

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.

4 REPLIES 4
nmrao
Community Hero

@oranjezhau
Does it work in java with your example code?


Regards,
Rao.
nmrao
Community Hero

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_0-1624638797478.png

 



Regards,
Rao.

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

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());

}
}

cancel
Showing results for 
Search instead for 
Did you mean: