I'm trying to create selenium tests for one site. In short, when a user opens the site, a CMS adds some dynamic elements (HTML + JS) to the page.
When I run tests on FF driver - all is OK.
FF Driver config:
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(CapabilityType.ELEMENT_SCROLL_BEHAVIOR,1);
return new FirefoxDriver(desiredCapabilities);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
Some page part, in this case.
driver.getPageSource()
As you can see, the dynamic block does exist.
But in the case of HtmlUnit:
HtmlUnitDriver htmlUnitDriver = new HtmlUnitDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
... the dynamic block doesn't exist: http://pastebin.com/b4iRGzjM
Can you please suggest how I can fix it or share some thoughts?
I tried:
htmlUnitDriver.setJavascriptEnabled(true);
But I got the following error: http://pastebin.com/qRazGjGY