Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command execution time limit reached #388

Closed
gherrink opened this issue Nov 6, 2013 · 8 comments
Closed

Command execution time limit reached #388

gherrink opened this issue Nov 6, 2013 · 8 comments

Comments

@gherrink
Copy link

gherrink commented Nov 6, 2013

Hallo I'm using Mink with SahiDriver an when i try to run my test i get the Error:

Command execution time limit reached: `_sahi.setServerVarPlain('___lastValue___527a0fd5d09e6', (function(){
            var count = 0;
            while (_sahi._byXPath("(//html/.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'Usr_usrname' or ./@name = 'Usr_usrname') or ./@id = //label[contains(normalize-space(string(.)), 'Usr_usrname')]/@for) or ./@placeholder = 'Usr_usrname')] | .//label[contains(normalize-space(string(.)), 'Usr_usrname')]//.//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')])["+(count+1)+"]")) count++;
            return count;
        })())` (Behat\SahiClient\Exception\ConnectionException)

I'm trying to find a Field with:

    public function __construct(array $parameters)
    {
        $driver = new \Behat\Mink\Driver\SahiDriver('firefox',
            new \Behat\SahiClient\Client(
                new \Behat\SahiClient\Connection(null, 'localhost', 9999)
            )
    );
        $this->session = new \Behat\Mink\Session($driver);
        $this->session->start();
    }

    /**
     * @When login :usr with :pw
     */
    public function loginWith($usr, $pw)
    {
        $this->session->visit('http://localhost/CMS/index.php/login/login');
    $page = $this->session->getPage();
    $field = $page->findField('Usr_usrname');
    $field->setValue($usr);
        return true;
    }

The Browser is opening normaly then my page is loaded after this apears the error.

@aik099
Copy link
Member

aik099 commented Nov 6, 2013

Please post relevant page HTML part.

Maybe there is no such field (with "name" or "id" attribute matching "Usr_usrname") on a page? Or this field doesn't support setting value to it (e.g. it's a DIV).

@gherrink
Copy link
Author

gherrink commented Nov 6, 2013

I just tryed to get the hole page with

$driver = new \Behat\Mink\Driver\SahiDriver('firefox',
        new \Behat\SahiClient\Client(
            new \Behat\SahiClient\Connection(null, 'localhost', 9999)
)
);
$session = new \Behat\Mink\Session($driver);
$session->start();
$session->visit('https://localhost/CMS/index.php/login/login');
echo $session->getPage()->getContent();

and get this error:
Command execution time limit reached: _sahi.setServerVarPlain('___lastValue___527a9575b8270', document.getElementsByTagName("html")[0].innerHTML)

Here is my html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="de" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="/CMS/assets/2dc9b87c/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/CMS/assets/2dc9b87c/css/yiistrap.css" />
<script type="text/javascript" src="/CMS/assets/bd973420/jquery.js"></script>
<title>CMS - Login</title>
    </head>

<body>

<div class="container" id="page">

    <nav class="navbar navbar-default"><div class="container"><div class="navbar-header"><a class="navbar-brand" href="/CMS/index.php">CMS</a></div><ul class="navbar-nav nav" id="yw1" role="menu"><li role="menuitem"><a tabindex="-1" href="http://localhost/CMS/index.php/site/index">Home</a></li><li role="menuitem"><a tabindex="-1" href="http://localhost/CMS/index.php/site/page?view=about">About</a></li><li role="menuitem"><a tabindex="-1" href="http://localhost/CMS/index.php/site/contact">Contact</a></li><li visible="1" class="active" role="menuitem"><a tabindex="-1" href="/CMS/index.php/login/login">Login</a></li></ul></div></nav>          <ul class="breadcrumb"><li><a href="/CMS/index.php"><i class="glyphicon glyphicon-home"></i></a><span class="divider"></span></li><li class="active">Login</li></ul><!-- breadcrumbs -->


    <div id="content">
    <h1>Login</h1>

<form role="form" id="yw0" class="form-horizontal" action="/CMS/index.php/login/login" method="post"> 
    <fieldset>
        <div class="form-group"><label class="col-md-2 control-label required" for="Usr_usrname">Benutzername <span class="required">*</span></label><div class="col-md-10 controls"><input name="Usr[usrname]" id="Usr_usrname" class="form-control" type="text" maxlength="20" /></div></div>     <div class="form-group"><label class="col-md-2 control-label required" for="Usr_password">Passwort <span class="required">*</span></label><div class="col-md-10 controls"><input name="Usr[password]" id="Usr_password" class="form-control" type="password" maxlength="64" /></div></div>      <div class="form-group"><div class="col-md-10 controls"><label class="col-md-2 checkbox"><input id="ytUsr_remember" type="hidden" value="0" name="Usr[remember]" /><input name="Usr[remember]" id="Usr_remember" value="1" type="checkbox" /> Erkene mich.</label></div></div>  </fieldset>

    <div class="form-actions"><button class="btn btn-default" type="submit" name="yt0">OK</button> <a class="btn btn-default" href="/CMS/index.php/login/register">Registrieren</a></div> 
</form></div><!-- content -->

    <div class="clear"></div>

    <div id="footer">
        Copyright &copy; 2013 by My Company.<br/>
        All Rights Reserved.<br/>
        Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a>. </div><!-- footer -->

</div><!-- page -->

<script type="text/javascript" src="/CMS/assets/2dc9b87c/js/bootstrap.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
jQuery('body').popover({'selector':'a[rel=popover]'});
jQuery('body').tooltip({'selector':'a[rel=tooltip]','container':'body'});
/*]]>*/
</script>
</body>
</html>

@aik099
Copy link
Member

aik099 commented Nov 6, 2013

Seems to be Sahi-specific issue. You should post there (https://github.com/Behat/MinkSahiDriver) instead I guess.

Try reducing page size by keeping only empty BODY tag with element you need to find in it. If all works, then it's probably Sahi not liking large pages I guess.

@gherrink
Copy link
Author

gherrink commented Nov 7, 2013

I have found the reason I used a https connection when I disabled it sahi was able to find the input field and print the text.
I'll post this problem @ SahiDriver.

@gherrink
Copy link
Author

gherrink commented Nov 7, 2013

Thank you for your help.

@boazrymland
Copy link

maybe SSL certification that it didn't like? (I've had something similar in the past that I never got to investigate).

@aik099
Copy link
Member

aik099 commented Nov 7, 2013

@mrbirne , can you please mention this issue in the issue you've posted on Sahi driver page?

Also maybe sahi by default (like curl) doesn't like self-generated ssl certificates and doesn't show contents from such websites.

@gherrink
Copy link
Author

gherrink commented Nov 7, 2013

Thanks for your help I posted the issue here: https://github.com/Behat/MinkSahiDriver/issues/17 hope this will help someone else.

@aik099 aik099 closed this as completed Dec 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants