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

Popular Categories

How to Handle Dynamic flex components Using Selenium Webdriver?

+4 votes
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 {
            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 {
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

0 votes
0 answers 254 views
+2 votes
1 answer 201 views

Not a Member yet?

Ask to Folks Login

My Account
345 Folks are online
2 members and 343 guest online
Your feedback is highly appreciated