Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SeleniumWebDriver的Facebook身份验证_Facebook_Selenium_Webdriver - Fatal编程技术网

使用SeleniumWebDriver的Facebook身份验证

使用SeleniumWebDriver的Facebook身份验证,facebook,selenium,webdriver,Facebook,Selenium,Webdriver,使用Selenium WebDriver,我想处理Facebook身份验证并使用HtmlUnitDriver获取访问令牌,我该怎么做?很多函数的用途您必须推断,但这是我编写的oauth流本身的测试: $this->loginAsTestUser(); $oauth_uri = $this->fbURI() ->setPath('/dialog/oauth') ->addQueryData('client_id', self::RELL_APP_ID) -&g

使用Selenium WebDriver,我想处理Facebook身份验证并使用HtmlUnitDriver获取访问令牌,我该怎么做?

很多函数的用途您必须推断,但这是我编写的oauth流本身的测试:

$this->loginAsTestUser();

$oauth_uri = $this->fbURI()
  ->setPath('/dialog/oauth')
  ->addQueryData('client_id', self::RELL_APP_ID)
  ->addQueryData('redirect_uri', self::RELL_URL);
$this->open($oauth_uri);
$this->platform->tosApp();

$code = $this->getURI()->getQueryData('code');
$this->assertNotEmpty($code, 'No code returned in redirect url');

$token_uri = $this->fbURI('graph')
  ->setSecure(true)
  ->setPath('/oauth/access_token')
  ->addQueryData('client_id', self::RELL_APP_ID)
  ->addQueryData('client_secret', self::RELL_SECRET)
  ->addQueryData('code', $code)
  ->addQueryData('redirect_uri', self::RELL_URL);
$this->open($token_uri);
$this->assertRegExp(
  '/access_token=.+/', $this->source(),
  'No access token returned in source');

我相信这是在RESTAPI级别使用HTTP请求,绕过Selenium执行UI登录?