is there any way to do this in ranorex. put simply what i want to do is:
(windows/web)
kick off the automation
the automation runs a sahi web script which creates a random username and drops this into a text file
ranorex to read this text file and assign the content to a variable
ranorex kicks off desktop app and logs in with the newly created username
Reading files on the fly
Re: Reading files on the fly
Why don't you just create the random name in Ranorex? It is .NET based, so anything you can do with .NET you can do with Ranorex.
Code: Select all
class NameGenerator {
string lowerChars = "abcdefghijklmnopqrstuvwxyz";
string upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Random r = new Random();
public string GetNewRandomName(int length, bool initialCap) {
StringBuilder name = new StringBuilder();
if (initialCap) {
name.Append(upperChars.ToCharArray()[r.Next(0, upperChars.Length)]);
} else {
name.Append(lowerChars.ToCharArray()[r.Next(0, lowerChars.Length)]);
}
for (int i = 0; i < length -1; i++) {
name.Append(lowerChars.ToCharArray()[r.Next(0, lowerChars .Length)]);
}
return name.ToString();
}
}
Shortcuts usually aren't...