Simpletest browser (php) on an asp site that doesn't allow direct linking

♀尐吖头ヾ 提交于 2019-12-13 08:06:58

问题


I'm trying to use Simpletest's scriptable browser to test out forms and links on an ASP site.

See this site:

http://www.acgme.org/adspublic/default.asp

If you click on the links (under the "search" section) in the left frame, the content in the right frame changes. If I direct link to the links on the left, I get an error.

Using simpletest:

<?php
    require_once('../simpletest/browser.php');
    $browser = &new SimpleBrowser();
    $browser-> useCookies();
    $browser-> useFrames();
    $browser->get('http://www.acgme.org/adspublic/default.asp');
    $browser->clickLink('Sponsoring Institutions');
    $content = $browser->getContent();
    echo $content;
?>

The "sponsoring institutions" page doesn't show but rather the error.

Any ideas? Or is there a different way to do this? I've Used Selenium for this, but I really need something server side that doesn't show the actual browser running (like selenium).

来源:https://stackoverflow.com/questions/6284003/simpletest-browser-php-on-an-asp-site-that-doesnt-allow-direct-linking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!