No, because new scala.util.Random().nextInt ... returns something else every time, which is convincingly explained by Him.
However, you can just pass the seed, then it will be a pure function, because it will return the same random string every time. You can add the seed as a parameter or just fix it inside the random string method.
Finally, I noticed that you wrote a huge amount of code to create a random string. I suggest you take a look at ScalaCheck, which has many useful functions for generating random things (for unit tests), String comes out of the box.
If you don't want to pull in the library, you can still make this code more concise:
def randomString(fromChars: List[Char], length: Int): String = { val rand = new Random(1234)
Watch it return the same value every time
scala> randomString("asdf".toList, 10) res0: String = dsfafssdsa scala> randomString("asdf".toList, 10) res1: String = dsfafssdsa
source share