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

2 Answers

+1 vote
by Expert (4.6k 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. 

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 {
            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"];
            var groupingMenu:GroupingMenu = new GroupingMenu();
            groupingMenu.addEventListener(GroupingMenuEvent.MENU_CLICK, onMenuClick);
            groupingMenu.groupingMenuRenderers = groupingMenuRenderers;
            /**    var spacer : Spacer = new Spacer();
             spacer.percentHeight = 100;
            if (groupVOs.length > 0) {
                var vo : GroupVO= groupVOs.getItemAt(0) as GroupVO;           
                if (vo.children && vo.children.length > 0) {
                } else {
Please suggest me solution on this.
The only way to interact with Flex applications using WebDriver is by using the JavaScriptExecutor to invoke JavaScript commands

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated