在参考配置中,此部分可能很有趣: // The params object will be passed directly to the protractor instance, // and can be accessed from your test. It is an arbitrary object and can // contain anything you may need in your test. // This can be changed via the command line as: // --params.login.user 'Joe' params: { login: { user: 'Jane', password: '1234' } },您可以在代码中像这样访问params对象: browser.params.login.user因此,在您的情况下,如果您这样调用量角器:protractor ... --params.login.user=abc --params.login.password=123您可以像下面这样在代码中访问这些变量:browser.params.login.user 和 browser.params.login.password