Search code examples
javaphpselenium-webdrivertestngfunctional-testing

Testing user input with selenium


I'm a student that's employed by a University to write tests to verify if code can be put into production on a website. Basically, I compare a series of expected results with what they actually return. One of the areas that I'm supposed to test is a forms page that has several fields where the user can input information, such as:

<div class="label">Title: </div>
<div class="html"><input id="title" size="40" name="title" type="text" value="" /></div>

I need to test various inputs that might break this code or cause problems. I was just going to make an array of Strings and test them but I'm having trouble thinking of good ideas of what to put inside it.

I already told them I think they should put a limit on the size of a String that can be input by the user, but after that I'm not sure exactly what I'd want to check.

If anyone could recommend a list of Strings or something that is commonly used in tests like this I would appreciate it.


Solution

  • Here similar Question answered here , might help Example string to test input boxes

    you can try all sort of Numeric Input/Text Input combinations with special chars.

    or if you want to try CSS (Cross Site Scripting) try strings like

    <script type='text/javascript'>alert('pwnd');</script>
    

    Read more on

    Cross Site Scripting