Storing special characters in array & input in field

Hi everyone....

I am looking for help for below mentioned case.

I need to store different special characters in a variable/array/list and then input each of these special char one by one in a textfield.
Able to do it for alphabets and digits.

regards
PM

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    What are the special characters and what problem are you having doing it?
  • Hi Matt,

    Set of special characters is say (!,@,#,$,^,&,*,<,?)

    now I need to input a value in text field that can have First letter as special character(using from above list) and then perform search.

    If no validation appears then it will pick another special char from list as first char of input value and perform search.

    If validation appears that first char is special char then exit loop.

    these loop needs to be continue until all the specials chars from list are checked.

    The code that I used to check first char is not number as follows:
    repeat with n=0 up to 9
    Click "textfield"
    Typetext n
    Typetext Test  //Final input value is in form 1Test, 2Test etc in textfield
    Typetext Escape  //remove virtual keypad        
    Click "Search"   //perform search
    If not ImageFound ("Validation")
                    Log error  "No validation"
                    CaptureScreen(Name:"path", increment:YES)
              repeat until ImageFound("textfield")  //remove prefilled data from textfield
                     Typetext backspace
              end repeat
    else
                 CaptureScreen(Name:"path1", increment:YES)
    end If
    end repeat
    
    Regards,
    PM
  • Currently I am able to read value from an external file. Can you please how can I store these values into an Array variable? any help would be much appreciated.
  • Hi there!

    The insert command is used to put something into a list. So...
    set charFile to file "/Users/PM/Desktop/CharFile.txt"
    
    repeat with each character char of charFile
    	insert char after charList
    end repeat
    

    Then you can access each of those characters as an item of charList:

    repeat with each item char of charList
    	TypeText char
    end repeat
    

    Happy Scripting,
    Pamela :)
Sign In or Register to comment.