开发者

How do you do HTML form testing without real user input simulation?

开发者 https://www.devze.com 2022-12-25 12:20 出处:网络
this question is like this one, except it\'s for PHP testing via browser. It\'s about testing your form input.

this question is like this one, except it's for PHP testing via browser. It's about testing your form input.

Right now, i have a form on a sin开发者_运维问答gle page. It has 12 input boxes. Every time i test the form, i have write those 12 input boxes in my browser.

i know it's not a specific coding question. This question is more about how to do direct testing on your form

So, how to do recursive testing without consuming too much of your time ?


I think Selenium Remote Control is one of the most popular names in the field of web interface testing. See for example this question.


If you don't want to use some big programs for test just one small form - you can use your own testing bike :)

    $args = array(/* Your _POST params */)
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url); // Your local|remote url
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    // Parse the response here
    // You may specify the loop with need args for your 12 checkboxes
0

精彩评论

暂无评论...
验证码 换一张
取 消