Question

I am using Intel's html5 app development framework. Particularly, I am using their carousel plugin. But I suspect knowledge of webdriver is more useful here.

The way their carousel works is that the pages float next to each other inside a div which has a limited width and overflow hidden. You can only see one of the pages at a time through the div "viewport".

When you touch to move to the next div, it applies a css transform to animate sliding the page divs past. This works fine. However webdriver has trouble with elements inside the animation div.

When you are on the first page, selenium reports all elements (on both pages) as displayed, even though half of them are hidden. Once you have transitioned to the second page, selenium reports all elements (on both pages) as not displayed.

I tracked it down to this css property that gets applied to the animation div:

-webkit-transform: translate3d(-1024px, 0px, 0);

When this is applied, selenium thinks this element is invisible. When I remove it using Chrome developer tools, it thinks they are all visible.

Two ways you might be able to help me:

  • Can I get selenium to report correctly the visibility of these elements? Perhaps by tweaking the way the carousel works? (It is open source).
  • Can I tell selenium to just click the element anyway, even though it is "not visible"?
Was it helpful?

Solution

This solves the problem, by getting around the bug in selenium.

new Actions(driver).MoveToElement(element).Click().Perform();

Selenium can click on the link using this code. Now I just need to try and get a minimal example to use as a bug report to the maintainers of selenium... tricky.

OTHER TIPS

I've found a tweak for the carousel that seems to work, but it may mess up the behaviour in some way I haven't anticipated. I replaced this line, in moveCSS3

el.style[$.feat.cssPrefix+"Transform"] = "translate" + translateOpen + distanceToMove.x + "px," + distanceToMove.y + "px" + translateClose;

with

el.style["margin-left"] = distanceToMove.x + "px";
el.style["margin-top"] = distanceToMove.y + "px";

which seems to work.

Other answers are welcome. Is this a bug I should report to selenium?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top