Automating a flex application in selenium WebDriver.
Himanshu Tewari
Senior Product Manager | Driving Growth, Retention & Strategic Roadmaps | PM from ISB | CSPO? | Travel Vlogger
Automating a flex grid: It was an important task in my last project I had to develop an automation framework which can automate flex grid so I researched a lot about automating flex grid and after some time I was successful in the task at hand .
There are couple of methods to automate flex like
- With the help of Selenium Flex API or
- SIKULI API.
Link for further reading : Flex in selenium- Sikuli-api vs sfapi
I am using SF API , as can be analysed from above link :
So here I am sharing my analysis with you.
Prerequisite :
- Download selenium flex API .
- Make sure you have code access to that flex project which you are going to automate.
- eclipse with flex plugin.
Step 1 : After downloading selenium flex API, Open flex project in eclipse and browse lib folder. Paste SeleniumFlexAPI.swc(This file will be in selenium flex API zip) in the folder.
Step 2 : Compile the code after adding that file in lib folder. after putting that SeleniumFlexAPI.swc file in lib clean the project and compile the project again with adding this path given below in flex compiler.
-include-libraries "libs\SeleniumFlexAPI.swc"
For flex compiler : - Right-click on the project and select properties and type flex compiler.
Step 3 : Download user extension file which is the file of a set of functions used in selenium .
How to use user extension functions :
Now the test case is to click on an element in flex. all functions are available in user extension file.
Now the example of using clicking an element :
final FirefoxDriver driver = new FirefoxDriver();
final FlexWebDriver flexDriver = new FlexWebDriver(driver, “my-application”);
driver.get(“https://localhost:8080/application”);
Assert.assertEquals(“true”, flexDriver.click(“aButton”));
For full explanation and user extension code: Source
Principal Software Quality Assurance Engineer at Strategic Systems International
6 年Done :) thank you?