Hi,
We need to generate random string in Thai language.
Please suggest how we can achieve the same.
Hi Seema,
FakerLibrary is quite useful for this sort of thing, you just need to load it with the relevant locale, in your case Thai (th_TH).
Here’s an example to get you started:
Seema-0.robot
*** Settings ***
Library FakerLibrary locale=th_TH
*** Variables ***
*** Test Cases ***
Random Thai Words
${word}= Word
Log ${word}
Log To Console ${word}
${words}= Words
Log ${words}
Log To Console ${words}
Random Thai Phrases
${string}= Sentence
Log ${string}
Log To Console ${string}
# didn't return Thai phrase
${string}= Catch Phrase
Log ${string}
Log To Console ${string}
Example output
% robot Seema-0.robot
==============================================================================
Seema-0
==============================================================================
Random Thai Words
..แต่ง
...['สมอง', 'แกะ', 'ลืมคาว']
Random Thai Words | PASS |
------------------------------------------------------------------------------
Random Thai Phrases
..เสรีภาพหน้ากากโดยเรียงสีแดงเชื้อโรค
...Balanced multi-state database
Random Thai Phrases | PASS |
------------------------------------------------------------------------------
Seema-0 | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output: /Users/dave/tmp/Seema/output.xml
Log: /Users/dave/tmp/Seema/log.html
Report: /Users/dave/tmp/Seema/report.html
Sorry, I don’t speak/read/write Thai so don’t know if these are valid words? hopefully this is what you are after
Dave.