使用Selenium和Chrome WebDriver测试PayPal结账功能。
我已经尝试使用另一个域名、localhost和127.0.0.1。
值得注意的是,我正在Vagrant机器(homestead)中运行。
手动运行测试也可以正常工作。我认为问题在于环境变量PAYMENT_SANDBOX_PAYPAL_URL=http://localhost:8000/checkout/
,但这很令人困惑,因为据我所知,使用WebDriver自动化测试时不应该有任何区别。
这是与Vagrant和我的主机有关的网络问题吗?我该如何诊断这个问题?
我知道这是一个非常特定的问题,适用于上述设置,但我认为像我一样的新手Selenium用户会发现它很有用,特别是在使用Codeception和Laravel时。
也许这与白名单IP有关?以下是当前命令。
java -jar vendor/se/selenium-server-standalone/bin/selenium-server-standalonjar -Dwebdriver.chrome.bin="/usr/bin/google-chrome" -Dwebdriver.chrome.driver="vendor/bin/chromedriver" -Dwebdriver.chrome.options="--whitelisted-ips=173.0.82.77,127.0.0.1"