Automated cross-browser webtesting with Sahi
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Alternative Title |
| |
Title of Series | ||
Number of Parts | 64 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/45948 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
FOSDEM 20111 / 64
3
7
10
11
17
19
21
28
33
34
35
37
40
44
48
49
52
55
57
59
62
63
64
00:00
Web browserSoftware testingComputer wormGamma functionAutomationComputer networkWeb applicationMultiplication signForcing (mathematics)Event horizonStatistical hypothesis testingOpen sourceComputer animationXMLLecture/Conference
00:43
Computer wormSoftwareWeb browserDynamischer TestOpen sourceSoftware testingMultiplication signSuite (music)Statistical hypothesis testingScripting languageWeb applicationForestGroup actionComputer animationLecture/Conference
01:15
Statistical hypothesis testingWeb browserDependent and independent variablesParsingProxy serverJava appletSanitary sewerIndependence (probability theory)Formal languageDevice driverSoftware testingStructural loadWeb pageParallel portDatabaseProgrammer (hardware)Function (mathematics)Wechselseitige InformationConvex hullEmailMaxima and minimaMenu (computing)Motion blurProxy serverPairwise comparisonAxiom of choiceDynamical systemWebsiteWeb pageWeightGame controllerStatistical hypothesis testingDatabaseRow (database)Multiplication signComputer fileElement (mathematics)Theory of relativityCuboidLevel (video gaming)Field (computer science)Group actionNetwork topologyEvent horizonWeb browserHTTP cookieTrailView (database)Formal languageInternetworkingScripting languageSoftware testingConditional-access moduleFunctional (mathematics)Office suiteType theoryResultant1 (number)Presentation of a groupWeb 2.0Drop (liquid)Drag (physics)Computer animationLecture/Conference
06:05
Bookmark (World Wide Web)Scripting languageComputer fileElectronic mailing listStatistical hypothesis testingElement (mathematics)View (database)State of matterWeb browserComputer fileScripting languageServer (computing)WebsiteConnected spaceGame controllerLine (geometry)Data loggerInstance (computer science)Ferry CorstenPoint (geometry)Link (knot theory)Computer animationLecture/Conference
08:02
TouchscreenScripting languageGastropod shellDisk read-and-write headShared memory2 (number)Android (robot)Library (computing)Set (mathematics)Extension (kinesiology)Java appletData recoveryFunctional (mathematics)Web browserClient (computing)Mobile appStapeldateiStatistical hypothesis testingScripting languageSoftware developerMobile WebElectronic visual displayServer (computing)Proxy serverGastropod shellMultiplication signSoftware development kitBitIntegrated development environmentNichtlineares GleichungssystemInverter (logic gate)Computer animationLecture/Conference
10:24
Statistical hypothesis testingHidden Markov modelWeb pageException handlingElement (mathematics)Multiplication signSoftware testingWeb applicationInformationComputational complexity theoryStandard deviationParallel port2 (number)Content (media)WeightMultiplicationAnalytic continuationINTEGRALFile formatEvent horizonLimit of a functionComputer animationLecture/Conference
15:10
XML
Transcript: English(auto-generated)
00:07
Yeah, hello, ladies and gentlemen. I'm glad to be here and tell you something about Zai. And I think I should give him the talk, a more provoking name, like, why do you guys still use selenium?
00:21
I met in the FOSSMB event yesterday, two guys, they're working with selenium, and they told me about some problems they face, and I always were like, yeah, okay, Zai solves the problems. Zai is an open source test tool for web applications.
00:41
How do I... An open source tool for testing of web applications. I'm working with Zai for a few months now, and it feels very fun to work with, I feel very comfortable with it, and it's very fast and easy to use and easy to learn. And I want to present to you why I feel it's so easy to work with Zai.
01:05
You can create dynamic test scripts and big test suites with no effort, it really saves your time. It works with a Java-based proxy server.
01:21
This proxy server executes JavaScript to do the user events like, you're going to a website and you're inserting text or drag and drop or check some boxes, and logging in and all the stuff the user would do, and even more. It can handle cookies, for example.
01:40
The tests are developed directly in the browser. That means you have a new browser tab where you create your tests. I will show that later. The browser dependency is a remarkable feature of Zai.
02:03
Browsers tests can be created and running on nearly every browser, the present ones and future browsers, as long as they support JavaScript. Let's say you write a test with Firefox, then you can automate the tests on Opera, Safari, Internet Explorer, and Chromium, and many, many more.
02:25
You can choose between two languages to write your scripts. I prefer JavaScript, you may prefer Ruby, it's your choice. In comparison to other tools, you have no need for weights,
02:45
and you have no need for XPath, which makes dynamic websites and dynamic scripts really easy to handle. You don't get frustrated when the get element by ID changes all the time, you reload the page.
03:03
I'll explain that further later when it comes to the Zai controller where you develop your scripts. Databases are handled very well, data-driven testing is really fun to work with. When you start a Zai proxy, you just browse to any site you want to be tested,
03:25
and with the controller, double-click, you open the Zai controller in a new tab. I hope you can see it right. This is the Zai controller. Even if you have no experience with JavaScript, you can create tests just by copying and pasting the functions which offer the Zai controller.
03:43
Just insert a name, press record, and then you do your actions. You navigate, you type in text, check boxes, you log in, and everything. Every step you have done will be shown here.
04:01
You can even type in your own text in this field and test it by just one click. You see the result in the browser. The accessing of elements is pretty easy. You hold the control button and you move the mouse over your web page,
04:21
and in this accessor field, they will show up the element, the DOM element you are pointing to. You get alternative accessors anytime, so you don't need to name the element. You could say, yeah, I want the third headline or whatever.
04:43
The really neat thing is the relational accessors. The controller Zai comes with an inbuilt API which is based on JavaScript. There are the commands in, under, and near where you can locate, where you can point to an element, just in relation to one another.
05:05
Let's say, I don't know how this text field is named. Then I just say, I want the first text field under the text box, which I know, and want to insert some text, like five stars.
05:21
You can do this with every element. You can access them by the relation in the DOM tree, just by saying, yeah, I want the third headline in this field near the picture. I don't know. You can do everything. It's pretty easy.
05:43
When you stop your recording, you just click on stop, and your test script is created. This is just a plain text file. Running the test manually is even easier.
06:02
You just click on the playback tab. Then, yeah, here it is. Just click on the playback tab, insert the script name and the website you want to be tested, where you want to get tested, and press play.
06:21
Then you lean back and watch the Zai controller all the work. You will see in the other browser tab, where your website is, how every step is executed. You can watch it and say, okay, everything is working fine. When it's not working fine, when it doesn't state success, when it doesn't state a
06:41
failure, then you just click on view log files, and the log files will show up. Do they show up? Yes, they show up. The log files are just a list of links, which points to these neat RTML log files, where you can just...
07:07
It's colorfully marked if everything went fine or not. You just see it in an instance, if a test fails or not, and what failed. Every command is listed.
07:21
Asserts, like, is the element there? Is the element visible? Is the text white? It's marked in green and red. Other failures that can happen, like server timeouts, connections are shown there in yellow.
07:43
And with just one click on every failed step, or any step, you get directed to the script, and you just see the line highlighted where the failure happened.
08:08
Zahi is very extendable. You can execute your batch files, your share script, you can include any Java library you want,
08:21
and just to give you an example of how you could extend it, we, at Head Issue, we extended it, we wanted to get it integrated into Hudson, and Zahi should run on a server, therefore on Headless.
08:43
We have to run the browser Headless, and with two simple share scripts, we created a virtual display, where the Firefox or the Chromium browser runs, and the second share script, which takes screenshots on failure.
09:01
Zahi has an inbuilt APE that can, which executes when a failure is happening, the recovery function, and it takes screenshots. You can visually check what went wrong. And with the Hudson integration, it's now possible to pretest nightly builds before they get released,
09:23
and if anything fails, they don't get released. So you can make sure that the really needed user, the really needed functions that you want to provide to your users and your clients are there and are working, whatever you do.
09:46
The second one is the simple redirecting of the proxy commands. It is now possible for us to run test scripts on the Android software development kit,
10:01
and therefore testing mobile applications in a realistic environment, in a realistic setting. Yeah, I think I talked a little bit fast. We have so much time left.
10:26
Yeah, that's it for now. Thank you for your attention. And if you have any questions, I'm here. I think I do my best to answer them. Can you explain what makes Zahi better than Selenium?
10:45
Yeah, as far as these people yesterday at the BA event told me, it was a lot of beer, and I don't really know if it's right, but they told me that they have the problem with the wait commands. Zahi doesn't need waits. It automatically detects when a page is loaded, or Ajax highly dynamic content.
11:05
It detects when it's loaded before executing the next step. Therefore, no failures can happen. With Selenium, you have to say wait for like five seconds until everything is loaded before continuing. Or the X pass, that you have to access an element by a constant name.
11:30
Do you know this? Get element by ID X epsilon. Zahi doesn't need it. Therefore, it can handle web pages where the ID is constantly changing, which Selenium doesn't.
11:50
Is this enough for you? Yes. Okay. Excuse me, I didn't understand that.
12:13
Could someone else... I didn't understand it, sorry. It doesn't integrate with Maven.
12:21
It's Maven. I didn't work with Maven yet. We just worked with Hudson. I don't have any other information on other integration tools.
12:48
Are there other formats? Some formats that Hudson can read, for example? So you see how many tests are here? Because HTML is not a good format for that. Yeah, that's the problem. We have to convert the HTML to something which gives us some information we can handle, that's sure.
13:10
But the inbuilt Zahi just gives us HTML. Checking visually if everything went right?
13:22
Can you repeat the question? Are you checking visually just the HTML? Do you have to look at the page to see if everything went right? Right now we do, but we are just working at it that it goes automatically. That's the goal, the golden goal that Hudson automatically detects if a build is clear or if it has failed.
13:51
I don't think this will take a long time until that is done.
14:05
Zahi is not so suitable for performance testing. You have the parallel execution of tests, you can multiswap the playback of tests, but when you do multiswap the playback with ten or more sessions,
14:21
it can happen that they are unpredictable failures, which doesn't come from the web application but from Zahi. When you have eight parallel executions or five, it's okay, but performance testing isn't very suitable.
14:44
I don't think so. Our time is nearly up. If there are any questions left, we can meet in front. Maybe you have some other ideas how to extend Zahi and you could tell me about him.
15:05
Thank you.