0

I have a little issue with some Webdriver tests in order to make them run using grid2.

My first issue is, that some tests need to check something on another domain, for example, I start on domain AA and then check a result on domain BB. Going to domain BB when I run local is not a problem, but using grid (Launching from a hub and testing on clients) the tests stop in that step.

The other problem, is that many findby functions only works locally, but using remote webdriver they return a null pointer exception (By xpath for example). Why is webdriver finding elements when test are local and not when tests run on remote pcs?

As a clarification, in both PCs (Hub and node) test run perfectly when I run them local, but also, in both, they fail using remote webdriver.

Any clues about his?

4

1 回答 1

0

浏览器、版本、设置、操作系统等可能有多种原因。您在说什么浏览器?你的硒版本是什么?这个问题在所有浏览器上都存在吗?您的域是否使用安全协议 HTTPS?定义远程 webdriver 的几行代码也会有所帮助。否则给出答案将是在黑暗中射击。您是否尝试过所需的功能?像下面这样的东西?

DesiredCapabilities capabilities =  DesiredCapabilities.firefox();
capabilities.setJavascriptEnabled(true);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);      
capabilities.setCapability(CapabilityType.HAS_NATIVE_EVENTS, true);
capabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
driver = new RemoteWebDriver(new URL("....."), capabilities);

也许这会引导您找到解决方案。如果您使用的是 IE,请确保您正在测试的域存在于受信任的站点设置中。

于 2012-06-30T16:52:23.933 回答