Hey there! any question in your mind? Ask It Now!.

Popular Categories





How to Handle Dynamic flex components Using Selenium Webdriver?

+4 votes
768 views
asked in Software Testing by Niks
Can anyone Help me, How to Handle Flex components that are generated runtime through Action script using Selenium WebDriver?

2 Answers

+1 vote
answered by seleniumGuru Expert (4,570 points)

Hi Niks ,

You can see procedure here to automate flex in selenium and if these components like text box or button are dynamic so you can check the pattern how these components are generating may be their ids are also generating in a particular sequence  and use for loop to create dynamic ids or give some example code which flex grid you have to automate so that I can help you better. 

commented by Niks
Below is the code snipet which dynamically generates Menu. Please guide me how will i access third menu generated by this acttion script(and id of Menucontainer on flex screen is "menuholder")

private function createMenu(value:ArrayCollection):void {
           
            app.menuHolder.removeAllChildren();
           
            var groupVOs:ArrayCollection = MainScreenUtil.getGroupVOs(value);
           
            var groupingMenuRenderers:Array = [];        
            for each (var data:Object in groupVOs) {
                var groupingMenuRenderer:GroupingMenuRenderer = new GroupingMenuRenderer();
                groupingMenuRenderer.label = data["groupCode"];
                groupingMenuRenderer.labelField = "groupName";
                groupingMenuRenderer.data = data;
                groupingMenuRenderer.children = data["children"];
                groupingMenuRenderers.push(groupingMenuRenderer);   
            }
           
            var groupingMenu:GroupingMenu = new GroupingMenu();
            groupingMenu.addEventListener(GroupingMenuEvent.MENU_CLICK, onMenuClick);
            groupingMenu.groupingMenuRenderers = groupingMenuRenderers;
           
            app.menuHolder.addChild(groupingMenu);
            /**    var spacer : Spacer = new Spacer();
             spacer.percentHeight = 100;
             app.menuHolder.addChild(spacer);*/
           
            if (groupVOs.length > 0) {
                var vo : GroupVO= groupVOs.getItemAt(0) as GroupVO;           
                if (vo.children && vo.children.length > 0) {
                    selectTarget(vo.children[0]);
                } else {
                    selectTarget(vo);
                }
            }
commented by Niks
Please suggest me solution on this.
commented by Amir
The only way to interact with Flex applications using WebDriver is by using the JavaScriptExecutor to invoke JavaScript commands

Related Questions

+10 votes
2 answers 10,325 views
0 votes
0 answers 207 views
+1 vote
1 answer 2,352 views
+2 votes
2 answers 893 views
+2 votes
1 answer 401 views
+2 votes
1 answer 137 views

Not a Member yet?

Ask to Folks Login

My Account
351 Folks are online
0 members and 351 guest online
Your feedback is highly appreciated