求助Flex隐藏的container
请先阅读下面一段话,引致Adobe官方“HP QuickTest Professional (QTP) 通常能够减少测试脚本中有关嵌套控件的详细信息量。它将从脚本中删除对测试结果或对
控件标识没有影响的容器。此规则适用于专用于布局的容器(例如 HGroup、VGroup、HBox、VBox 和 Canvas 容器),
但当这些专用于布局的容器用在 ViewStack、TabNavigator 或 Accordion 容器中时除外,在这些情况下,这些容器将被添
加到层次结构中,以提供导航。
使用嵌套容器时,需要谨防 ID 冲突。含有多个选项卡的容器(如 Accordion 和 TabNavigator 容器)可能在多个选项卡上
拥有同一标签。这些容器的 ID 派生自选项卡标签,因此,可能会有重叠 ID。”
这样做可能会把刚好能够防止冲突ID冲突的parent container给隐藏掉!!这个时候抓取children中有相同名字id的控件时候就冲突了。这种情况应该怎么办?急求答案。 希望得到Flex专家的回复 非常感谢 汗,没人关注 这个问题和开发争论了下 本来想要求开发为具有相同id的控件修改下 但是基于复用的原理 这些控件都继承于一个公共类 开发让它们的parent的名字不一样.就好比是不同namespace下的相同姓名class 编译的时候并不冲突!所以理论上开发的code不算是有问题的。而且我的要求也不算合理了。
QTP和Adobe就这样把父类container莫名其妙地无视掉了!搞得我非常头痛。。。。。。。。。。。。。。。后悔当初选QTP来自动化Flex了 UP UP UP UP UP 在SQAForums上得到专家帮忙。解决方案如下:
You have to do it in 3 steps.
Learn the actual object:
1. Learn the Object that's present in the container first.
Learn the Container Object:
2. Select the same object that you have learned previously (i.e the object present in the container) to learn. Now the "Object Selection - Add to Repository" window will display the hierarchy of your objects. Select the Container Object and Click OK.
Change the Object Hierarchy:
3. Right click the first object that you have learned & select cut. Then Select the Container Object, right click and select paste.
Note: You might have to go and set the index value to none.
Here is what i mean. Consider your current hierarchy as below
A->B->D
Now what you want is it to be A->B->C->D where C is the container
So if you can manually add C as a FlexObject in OR and associate some properties to it. Then you can identify the container. After that you can cut and move D under C manually. This way you will create a object hierarchy as required
A->B->C->D
But the success of the same would depend on if you are identifying C correctly or not
页:
[1]