dongrouli2667
2013-08-15 19:23
浏览 21
已采纳

使用Mink和Sahi,我如何使用FF以外的其他浏览器?

Whenever I run Sahi, it is using Firefox by default. What I am trying to do is have more control over the browser I use. I have followed instructions from http://mink.behat.org/#sahidriver

and my behat.yml is :

default:
  formatter:
    name: progress
  extensions:
    Behat\Symfony2Extension\Extension:
      mink_driver: true
      kernel:
        env: test
        debug: true
    Behat\MinkExtension\Extension:
      sahi: ~
      goutte: ~
      base_url: 'http://local.referral.com'
      default_session: sahi

My function is:

public function iAmOnHomepage()
    {

        $session = $this->getSession();
        $session->visit($this->locatePath('/'));

        $link = $session->getPage()->findLink('I am a Physician');

       if (null === $link) {
          throw new \LogicException("Home Page Not Loaded:
");   
       }
    }

How do I specify additional instructions like browser etc? Is that in code or in yml file.

If so how do I do it?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题