视图端口问题中的元素[Peculiar]

时间:2013-10-15 13:23:22

标签: java selenium selenium-webdriver

我以一种特殊的方式得到以下错误。

The point at which the driver is attempting to click on the element was not scrolled into the viewport. 

用户故事是这样的,如果在检查组中进行选择,则将启用具有少量字段的相应div。类似地,对于n个选择,将存在n个DIV。当我在div中只选择一个选项时,它按预期工作,但不适用于多个选项。

我已经阅读了一些内容并尝试了所有关于上述视口问题的可能组合。我的尝试和结果的工作如下。

1)尝试使用高级交互方法。 (Action class) - 相同的异常

2)访问java脚本执行程序 - 同样的异常

很快就会更新。 我已经尝试了所有定位机制的组合。一切都很完美,元素处于可见模式。但是当我对第二个DIV值执行任何操作时,我得到了上述异常。

可以采取哪些措施使元素处于工作模式?

编辑:

1.The DIV elements all are in view port and they all are accessible individually.
2. Div are enabled as per the check box selected
3.In a scenario, if we choose two check box, after a first selection you can edit the DIV and for the second selection the DIV will not be accessible. 
4. both DIVs are identical with respect to the elements/attributes/properties of the elements.
5. When a Active div is edited no other div will be available in the UI.

由于某些原因,我无法在此处生成可重复代码。

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。每个DIV实际上都有一个框架。编辑后隐藏这些帧,每次都打开一个新帧,所以当我访问第二个div时,我必须选择最新的帧。 我刚刚查询了帧数并继续使用最新的帧数。