Today I am going to share a very interesting topic with you. Android phone, what do you think when every I tell in front of you? Interesting or some even can tell me “no this is quite boring”. But if in over all we examine that then this is quite popular among the people. In north American countries iphone is dominating there is a little use of android. But if we consider in Asia then android is the king of this area. Because a lot of people are using and really become a fan of this. So whenever something being popular the depend software development rate also increase. So now days a lot of android app is developing all over the Asia. Even those software companies which are from West they are also investing in android app developing. • So whenever we are having a lot of android software developing then we have to perform the test operation on them too to ensure the quality. Right? Unlucky there were no tools for real test automation in android even in 2009 and 2010. Really surprising but true. Now we are in the pipeline of android test automation tools. Let’s think now how people normally test a mobile or android app? • You come up with a test plan based on the features of the application. • You take into account the requirements of the platform. • For Android, we're talking about stability, responsiveness, accessibility, performance, elegance, security, and so on. • it varies by company as it always has, but the fundamentals are the same. It requires a budget, personnel, hardware, and will. That is something like that. Previously when we use to do android test automation then we need the following materials to perform the test automation. Such as: · Android main project · Test project · IDE · Some tools even need the permission inside the mailfest.xml file. Now here is the point is. Many project is not develop in one company and submit to another company to test. So now your client how can belive in you that you will not steal the code from that project? Haha. Maybe you are thinking, “What nonsense are you saying? I never think so bad way!” But this is ture that maybe you are not thinking but many other people are there to think quite much about this. Even if I ask you how can you trust other people with your project. This was pretty hard for both side. So android test automation test was not speed up. Because people can’t trust each other. So they just project apk and confirm manual testing. But I belive that there is no limitation is not a real limitation. If we effort then we can overcome that too. So now totally I am going to tell you one new technology where you don’t need any project just apk which is enough to do test automation. So lets list which things are need for this automation • Android environment • IDE • Application.apk You must be thinking how this is possible. Right? Soon I will post a video demo on this.
19 Comments
The most significant benefits of traditional test automation are the decreased test execution time and cost, and increased test coverage for each testing cycle. The downside of test automation is the increased test development cost. In a typical test automation scheme, each test is first documented by a test engineer then scripted by an automation engineer. The cost benefit of automated testing comes through the repeated execution of the test automation suite. Since the cost of executing an automated test is far less than the cost of executing a manual test, eventually the decreased test execution cost will make up for the increased development costs.
For example, suppose that a test engineer costs your organization $60/hr, and an automation engineer costs your organization $100/hr. The test engineer can create 5 new test cases per hour during test plan development, and can execute 10 test cases per hour during test execution. The automation engineer can develop 2 test cases per hour. Once those test cases are completed, a test engineer can execute and analyze the results of 50 tests in one hour (typically the test engineer will run the tests overnight, or while he is doing some other work, then analyze the results once the test is done). Suppose you create a test plan with 1000 test cases: For manual testing, your initial test development cost is: 1000 tests * 1 hour/5 test cases * $60/hour = $12,000 The cost of executing all of the tests manually is: 1000 tests * 1 hour/10 test cases * $60/hour = $6,000 For automated testing, your initial cost is: $12,000 + 1000 tests * 1 hour/2 test cases * $100/hour = $65,000 The cost of executing all of the test cases w/ test automation is: 1000 tests * 1 hour/50 test cases * $60/hour = $600 The cost benefit of test automation is realized by running the tests several times (i.e. with each weekly or nightly build of your application). In this case, we begin to see a cost savings if we run the tests more than 12 times. There are several reasons why people choose to automate tests: o Speed up testing to accelerate releases o Allow testing to happen more frequently o Reduce costs of testing by reducing manual labor o Improve test coverage o Ensure consistency o Improve the reliability of testing o Allow testing to be done by staff with less skill o Define the testing process and reduce dependence on the few who know it o Make testing more interesting o Develop programming skills So here we go with the top challenges: 1) Testing the complete application: Is it possible? I think impossible. There are millions of test combinations. It’s not possible to test each and every combination both in manual as well as in automation testing. If you try all these combinations you will never ship the product 2) Misunderstanding of company processes: Some times you just don’t pay proper attention what the company-defined processes are and these are for what purposes. There are some myths in testers that they should only go with company processes even these processes are not applicable for their current testing scenario. This results in incomplete and inappropriate application testing. 3) Relationship with developers: Big challenge. Requires very skilled tester to handle this relation positively and even by completing the work in testers way. There are simply hundreds of excuses developers or testers can make when they are not agree with some points. For this tester also requiresgood communication, troubleshooting and analyzing skill. 4) Regression testing: When project goes on expanding the regression testing work simply becomes uncontrolled. Pressure to handle the current functionality changes, previous working functionality checks and bug tracking. 5) Lack of skilled testers: I will call this as ‘wrong management decision’ while selecting or training testers for their project task in hand. These unskilled fellows may add more chaos than simplifying the testing work. This results into incomplete, insufficient and ad-hoc testing throughout thetesting life cycle. 6) Testing always under time constraint: Hey tester, we want to ship this product by this weekend, are you ready for completion? When this order comes from boss, tester simply focuses on task completion and not on the test coverage and quality of work. There is huge list of tasks that you need to complete within specified time. This includes writing, executing, automating and reviewing the test cases. 7) Which tests to execute first? If you are facing the challenge stated in point no 6, then how will you take decision which test cases should be executed and with what priority? Which tests are important over others? This requires good experience to work under pressure. 8 ) Understanding the requirements: Some times testers are responsible for communicating with customers for understanding the requirements. What if tester fails to understand the requirements? Will he be able to test the application properly? Definitely No! Testers require good listening and understanding capabilities. 9) Automation testing: Many sub challenges – Should automate the testing work? Till what level automation should be done? Do you have sufficient and skilled resources for automation? Is time permissible for automating the test cases? Decision of automation or manual testing will need to address the pros and cons of each process. 10) Decision to stop the testing: When to stop testing? Very difficult decision. Requires core judgment of testing processes and importance of each process. Also requires ‘on the fly’ decision ability. Over to you: Many of you are working in manual and/or automation testing field. Though I have addressed many of above challenges in our previous articles, I want your views on handling these software testing challenges. Feel free to express your views in comment section below. Do you have interest in glassfish Admin GUI with selenium and experience the differences between silk testt and Selenium tools
1. Run Selenium from the build If you build admin-gui module you can find the README.SeleniumRC file under the ../glassfish/admin-gui/tests directory. Just follow the instruction from the file, you should be able to setup and run Selenium JBI tests with Glassfish Admin GUI. If you encounter a failure from your browser, open selenium test case files under java directory and replace statement selenium.waitForCondition("Selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD) by selenium.waitForPageToLoad( TIMEOUT_PERIOD) 2. Run Selenium with Glassfish V2 binary bit 1. You must setup the environment by installing Selenium IDE on your Firefox browser 2. Having ant 1.6.5 and jdk1.5.0_11 or latest version installed on your system 3. Create a AdminGUITest directory on your system and copy the following 4 files to the ../AdminGUITest/lib directory selenium-server.jar , selenium-java-client.jar, selenium-java-client-driver-tests.jar and testng-5.5-jdk15.jar andjunit.jar 4. Copy the simple test harness (AdminGUITest.jar file) to your AdminGUI directory and unjar the file 5. Update build.properties file with your setup environment 6. Start the selenium remote server (assume you're using a window system) cd %AdminGUITest.home% java -jar selenium-server.jar 7. Start glassfish domain1 8. Run the first AdminGUI test case cd %AdminGUITest.home% ant run-test 3. Differences between SilkTest and Selenium Navigating
The first thing you'll want to do with WebDriver is navigate to a page. The normal way to do this is by calling "get": driver.get("http://www.google.com"); WebDriver will wait until the page has fully loaded (that is, the "onload" event has fired) before returning control to your test or script. Interacting With the Page Just being able to go to places isn't terribly useful. What we'd really like to do is to interact with the pages, or, more specifically, the HTML elements within a page. First of all, we need to find one. WebDriver offers a number of ways of finding elements. For example, given an element defined as: <input name="passwd" id="passwd-id" /> we could use any of: WebElement element; element = driver.findElement(By.id("passwd-id")); element = driver.findElement(By.name("passwd")); element = driver.findElement(By.xpath("//input[@id='passwd-id']")); Filling In FormsWe've already seen how to enter text into a textarea or text field, but what about the other elements? You can "toggle" the state of checkboxes, and you can use "setSelected" to set something like an OPTION tag selected. Dealing with SELECT tags isn't too bad: WebElement select = driver.findElement(By.xpath("//select")); List<WebElement> allOptions = select.findElements(By.tagName("option")); for (WebElement option : allOptions) { System.out.println(String.format("Value is: %s", option.getValue())); option.setSelected(); } This will find the first "SELECT" element on the page, and cycle through each of it's OPTIONs in turn, printing out their values, and selecting each in turn. As you can see, this isn't the most efficient way of dealing with SELECT elements. WebDriver's support classes come with one called "Select", which provides useful methods for interacting with these. Once you've finished filling out the form, you probably want to submit it. One way to do this would be to find the "submit" button and click it: driver.findElement(By.id("submit")).click(); // Assume the button has the ID "submit" :) Alternatively, WebDriver has the convenience method "submit" on every element. If you call this on an element within a form, WebDriver will walk up the DOM until it finds the enclosing form and then calls submit on that. If the element isn't in a form, then the "NoSuchElementException" will be thrown: element.submit() Getting Visual Information And Drag And DropSometimes you want to extract some visual information out of an element, perhaps to see if it's visible or where it is on screen. You can find out this information by casting the element to a RenderedWebElement: WebElement plain = driver.findElement(By.name("q")); RenderedWebElement element = (RenderedWebElement) plain; Not all drivers render their content to the screen (such as the HtmlUnitDriver), so it's not safe to assume that the cast will work, but if it does you can gather additional information such as the size and location of the element. In addition, you can use drag and drop, either moving an element by a certain amount, or on to another element: RenderedWebElement element = (RenderedWebElement) driver.findElement(By.name("source")); RenderedWebElement target = (RenderedWebElement) driver.findElement(By.name("target")); element.dragAndDropOn(target); Moving Between Windows and FramesIt's rare for a modern web application not to have any frames or to be constrained to a single window. WebDriver supports moving between named windows using the "switchTo" method: driver.switchTo().window("windowName"); All calls to driver will now be interpreted as being directed to the particular window. But how do you know the window's name? Take a look at the javascript or link that opened it: <a href="somewhere.html" target="windowName">Click here to open a new window</a> Alternatively, you can pass a "window handle" to the "switchTo().window()" method. Knowing this, it's possible to iterate over every open window like so: for (String handle : driver.getWindowHandles()) { driver.switchTo().window(handle); } You can also swing from frame to frame (or into iframes): driver.switchTo().frame("frameName"); It's possible to access subframes by chaining switchTo() calls, and you can specify the frame by its index too. That is: driver.switchTo().frame("frameName") .switchTo().frame(0) .switchTo().frame("child"); would go to the frame named "child" of the first subframe of the frame called "frameName". All frames are evaluated as if from currently switched to frame. To get back to the top level, call: driver.switchTo().defaultContent(); There are several steps required to prepare the android device or emulator, the environment and the computer. These include: · Installing android-server.apk (the actual filename may differ e.g. if you use a prebuilt version it will include the release name). If you want to use an emulator, we currently recommend using one with Android 2.2 installed. The server doesn’t support earlier versions any more (it used to but limitations with the platform e.g. lack of support for XPath meant the project team have chosen to target a minimum of 2.2). There’s currently an issue with the Java-to-JavaScript bridge in version 2.3 of the emulator, so again we don’t recommend using it currently.) · Configuring port forwarding so your tests can communicate with the device or running instance of the emulator. · Starting the WebDriver Server on the Android emulator (or on a device). Configuring your eclipse project You will need to include the various jar files from the selenium project in order for your tests to use ‘RemoteWebdriver’. The AndroidDriver implements the RemoteWebdriver protocol. You can download a zip file from the selenium project site http://code.google.com/p/selenium/downloads/list e.g. selenium-java-2.0b1.zip currently. This file needs to be unzipped, which will unpack to 2 selenium jar files (the code and the javadoc documentation) and a series of 27 other jar files. All these files need to be added to the build path in your eclipse project. I suggest copying all the files into a common libs folder for your project. First, let's create an Android Virtual Device (AVD): $cd ~/android_sdk/tools/ $./android create avd -n my_android -t 12 -c 100M -n: specifies the name of the AVD. -t: specifies the platform target. For an exhaustive list of targets, run: ./android list targets Make sure the target level you selected corresponds to a supported SDK platform. -c: specifies the SD card storage space. When prompted "Do you wish to create a custom hardware profile [no]" enter "no". Now, start the emulator. This can take a while, but take a look at the FAQ below for tips on how to improve performance of the emulator. $./emulator -avd my_android & Install the WebDriver APKEvery device or emulator has a serial ID. Run this command to get the serial ID of the device or emulator you want to use: $~/android_sdk/platform-tools/adb devices Download the Android server from selenium download page To install the application do: $./adb -s <serialId> -e install -r android-server.apk Make sure you are allowing installation of application not coming from Android Market. Go to Settings -> Applications, and check "Unknown Sources". Start the Android WebDriver application through the UI of the device or by running this command: $./adb -s <serialId> shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity You can start the application in debug mode, which has more verbose logs by doing: $./adb -s <serialId> shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity -e debug true Sample Code: just put that inside a class and check the magic, Run the Testsimport junit.framework.TestCase; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.android.AndroidDriver; public class OneTest extends TestCase { public void testGoogle() throws Exception { WebDriver driver = new AndroidDriver(); // And now use this to visit Google driver.get("http://www.google.com"); // Find the text input element by its name WebElement element = driver.findElement(By.name("q")); // Enter something to search for element.sendKeys("Cheese!"); // Now submit the form. WebDriver will find the form for us from the element element.submit(); // Check the title of the page System.out.println("Page title is: " + driver.getTitle()); driver.quit(); } }
still confused ??? haha. Really no problem. Check my video tutorial on android webdriver. You will have your all questions answer. what is webdriver ? what is this doing now ? many questions running your mind. right ?
For example, Selenium, a popular and well established testing framework is a wonderful tool that provides a handy unified interface that works with a large number of browsers, and allows you to write your tests in almost every language you can imagine (from Java or C# through PHP to Erlang!). It was one of the first Open Source projects to bring browser-based testing to the masses, and because it's written in JavaScript it's possible to quickly add support for new browsers thatmight be released Like every large project, it's not perfect. Selenium is written in JavaScript which causes a significant weakness: browsers impose a pretty strict security model on any JavaScript that they execute in order to protect a user from malicious scripts. Examples of where this security model makes testing harder are when trying to upload a file (IE prevents JavaScript from changing the value of an INPUT file element) and when trying to navigate between domains (because of the single host origin policy problem). Additionally, being a mature product, the API for Selenium RC has grown over time, and as it has done so it has become harder to understand how best to use it. For example, it's not immediately obvious whether you should be using "type" instead of "typeKeys" to enter text into a form control. Although it's a question of aesthetics, some find the large API intimidating and difficult to navigate. WebDriver takes a different approach to solve the same problem as Selenium. Rather than being a JavaScript application running within the browser, it uses whichever mechanism is most appropriate to control the browser. For Firefox, this means that WebDriver is implemented as an extension. For IE, WebDriver makes use of IE's Automation controls. By changing the mechanism used to control the browser, we can circumvent the restrictions placed on the browser by the JavaScript security model. In those cases where automation through the browser isn't enough, WebDriver can make use of facilities offered by the Operating System. For example, on Windows we simulate typing at the OS level, which means we are more closely modeling how the user interacts with the browser, and that we can type into "file" input elements. With the benefit of hindsight, we have developed a cleaner, Object-based API for WebDriver, rather than follow Selenium's dictionary-based approach. A typical example using WebDriver in Java looks like this: // Create an instance of WebDriver backed by Firefox WebDriver driver = new FirefoxDriver(); // Now go to the Google home page driver.get("http://www.google.com"); // Find the search box, and (ummm...) search for something WebElement searchBox = driver.findElement(By.name("q")); searchBox.sendKeys("selenium"); searchBox.submit(); // And now display the title of the page System.out.println("Title: " + driver.getTitle()); Looking at the two frameworks side-by-side, we found that the weaknesses of one are addressed by the strengths of the other. For example, whilst WebDriver's approach to supporting browsers requires a lot of work from the framework developers, Selenium can easily be extended. Conversely, Selenium always requires a real browser, yet WebDriver can make use of an implementation based on HtmlUnit which provides lightweight, super-fast browser emulation. Selenium has good support for many of the common situations you might want to test, but WebDriver's ability to step outside the JavaScript sandbox opens up some interesting possibilities. These complementary capabilities explain why the two projects are merging: Selenium 2.0 will offer WebDriver's API alongside the traditional Selenium API, and we shall be merging the two implementations to offer a capable, flexible testing framework. One of the benefits of this approach is that there will be an implementation of WebDriver's cleaner APIs backed by the existing Selenium implementation. Although this won't solve the underlying limitations of Selenium's current JavaScript-based approach, it does mean that it becomes easier to test against a broader range of browsers. And the reverse is true; we'll also be emulating the existing Selenium APIs with WebDriver too. This means that teams can make the move to WebDriver's API (and Selenium 2) in a managed and considered way. If you'd like to give WebDriver a try, it's as easy as downloading the zip files, unpacking them and putting the JARs on your CLASSPATH. For the Pythonistas out there, there's also a version of WebDriver for you, and a C# version is waiting in the wings. The project is hosted athttp://webdriver.googlecode.com, and, like any project on Google Code, is Open Source (we're using the Apache 2 license) If you need help getting started, the project's wiki contains useful guides, and the WebDriver group is friendly and helpful (something which makes me feel very happy). So that's WebDriver: a clean, fast framework for automated testing of webapps. We hope you like it as much as we do! I need to get something straight: QA and QC are different. You may ask me. really ?
Why must I point this out? Because programmers don't seem to get it and use these terms interchangeably. so i will tell you like this ... QA is QualityAssurance butQC is QualityControl The difference is that QA is process oriented and QC is product oriented. Testing, therefore is product oriented and thus is in the QC domain. Testing for quality isn't assuring quality, it's controlling it. So still who was argue with me then for them is this clear to you my friend ?
Why all the fuss? There are lots of reasons to ensure the distinction between the two. Easily, the ones that come to mind are:
Start blogging by creating a new post. You can edit or delete me by clicking under the comments. You can also customize your sidebar by dragging in elements from the top bar.
|
AuthorI am Masud Parvez. Working as IT Senior Project Manager for RMIT University. Previously I built and run a distributed Test Center. My success was to turn that in to one of the most successful business units of the company. Categories
All
|