cancel
Showing results for 
Search instead for 
Did you mean: 

SoapUI | Groovy script | Cyrillic encoding in the file

Highlighted
Occasional Contributor

SoapUI | Groovy script | Cyrillic encoding in the file

Hello!

I have projectDir file with Cyrillic letters. Groovy Script set this letters from projectDir file to SoapUI properties, but when they are installed, they become unreadable. It's encoding problem, but I do not know what encoding is used in properties.


File content:

NameOfOrganization=Привет

Groovy Script:

import com.eviware.soapui.support.GroovyUtils;

// ==== Prepare properties for reading ==== //
def groovyUtils = new GroovyUtils(context);
def projectDir = groovyUtils.projectPath;
log.info "projectDir: " +projectDir
def props = new Properties();
new File(projectDir, "InstallAPs.txt").withInputStream {
	stream -> props.load(stream); 
}

def NameOfOrganization =String.valueOf(props["NameOfOrganization"])
testRunner.testCase.setPropertyValue("NameOfOrganization", NameOfOrganization)

Result:
2222.PNG

 

3 REPLIES 3
Super Contributor

Re: SoapUI | Groovy script | Cyrillic encoding in the file

Go to this path:-

SOAPUI_HOME/bin and then edit soapui-5.4.0.vmoptions and below line

-Dfile.encoding=UTF-8

 Save it and restart soapui again. You will see the changes in soapui->Help -> System properties.

Occasional Contributor

Re: SoapUI | Groovy script | Cyrillic encoding in the file

Hello!
Thank you for answer!
It didn't help.
Снимок.PNG
What file encoding should be? UTF-8?

Super Contributor

Re: SoapUI | Groovy script | Cyrillic encoding in the file

Try this value also:-

-Dfile.encoding=windows-1251

If it doesn't work also, Then raise a support ticket.

https://support.smartbear.com/message/?prod=ReadyAPI

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors
Top Kudoed Posts