2012-10-10

Pantech Sky Vega LTE EX IM-A820L, Rooting, Recovery, Installing Rom

[This is out dated, the process is ok, but the hosted files are missing. This process is only for 2.3.3. Learn the concept-thanks, shantonu]

In this article, we are going to learn how to root a Korean android set(Pantech Sky Vega LTE EX IM-A820L). We will also see how to install recovery in this set. Later on we will discuses detail basic on android rooting.
In this blog, we will just see how to do it. All credit goes to XDA developers and this site.

For Rooting : 
Step 1 : Install the driver of the phone (go to pentech site in Google chrome browser or use Google translate , then select you device and download the USB driver. And then install it)
Step 2: Change the phone connecting mode to USB Debugging enabled and allowing Unknown Source application when you connect the phone to PC.
To enable Unknown Source applications , Go to menu –> settings –> Applications –> select, Unknown Sources.
To enable USB Debugging , Go to menu –> settings –> Applications –> Development –> select, USB Debugging
Step 3 : Download and Extract Fast Boot driver from here and Rooting tool from here.
Step 4 : Connect the phone and Go to extracted rooting tool (..\A820Lroot) and run that file "run_me.bat"
This phone will be rooted after reboot and superuser App will be installed. Please check superuser App for rooting verification. If not, do the steps again.

For Recovery :
Step 1 : Download recovery58 and recovery6
Step 2 : Connect Phone to PC as USB mass storage.
Step 3 :  Extract the "A820L-recovery5.8.2.0"
Step 4 : Copy a. recovery folder under extracted A820L-recovery5.8.2.0 (there will be recovery5820.img file) b. A820L_Recovery 6011.zip . Past both in phone.
Step 5 : Use any root file explorer(I use ES Explorer) to copy that two file in the root folder(\root\ )of the phone memory
Step 6 : In the extracted A820L-recovery5.8.2.0, run 刷Recovery.exe. Phone will reboot to recovery
Step 7 : Choose, Install zip from sdcard -> choose zip from sdcard , select A820L_Recovery 6011.zip  and install it
Step 8 : After finishing installation, come back to first menu and go to advance -> reboot to recovery
Step 9 : After reboot, take a backup For taking backup, goto Backup and restore , choose backup format as tar. then take a backup(it will be clockworkMod backup in the phone memory)
While rebooting in the step 8,you will get a menu, if you select EXIT, then Full recovery will be re-flash and back to default recovery(this is temp mod), but if you select don't re-flash(middle option), then new recovery will be permanent.
Note : For default recovery , volume Up & Down are selecting option and SKY touch button is for entering the option.

For Custom Rom: 
When you took the backup of current ROM in previous step, there is a folder structure saved in the internal memory(EX-\sdcard \clockworkmod\backup\1970-02-15.21.52.02). This is the backup structure and restoring path. In this set, till now, it is not possible to install ROM directly. We have to use restore method to install new rom. For that we need rom which is kept as restoring format.
Note : This is possible if we have ClockworkMod recovery v6.0.1.1 installed.
Step1: Get latest ROM(Up to OCT 16, 2012) please download this 3 file
1. Part 1., 2. Part 2 , 3.Part 3
Step 2: Now keep all 3 files in a folder and extract any one by using 7zip. These are part files, so they will be extracted to a single folder.(Download Location of 7zip)
Step 3: After extraction , a folder will be created named as "1970-04-03.17.22.38". Connect your phone to computer
Step 4: Enable USB storage(so that we can access internal memory of mobile)
Step 5: Open windows explorer and Copy the folder to \clockworkmod\backup and Eject mobile from PB
Step 6 : Now, boot to Recovery( to do that, power off mobile, then press power button + volume down(-), keep pressing until the mobile goes to recovery mode.)
Step 7: Now, From recovery screen Go to Backup & restore
Step 7:Go to Restore and select the  "1970-04-03.17.22.38" to restore


And you have done it. You have latest version of Rom Installed. Just reboot and you will get new Rom.

Note : For ClockworkMod recovery , volume Up & Down are selecting option and power button is for entering the option

Notice.... Please do all of these by your own risk. I am not responsible for those. And, frankly I have got several data issues in the New ROM. But, rooting and recovery, taking backup is pretty Awesome.

Spatial Modes : 
Safe mode = Hold Vol Up  after Power
Recovery = Volume Down + Power
Emergency Mode(for self Upgrade) = inserting battery while pressing Vol Up+Vol down+Power

...Thanks....:)

2012-09-28

Introduction to Selenium WebDriver(Tab test)

In this following article we are going to see a simple code writing in selenium WebDriver using VS 2010.
Please set up environment for selenium webdriver in VS2010 with NUnit(you may see my previous post for that).
What the program will do ?
It will validate the tabs of an website. I am using http://www.kaz.com.bd/ for my example.
First, lets see the site. It has basic 4 tabs Home, Talents,Culture,Contact
image
To validate a tab we need
1. Is there any click event present?
2. Is there is any tab of that name?
3. Is the text (Name of the tab) is same as expected?
4. When we click, does the site goes to the expected destination?(after going there, the title will be loaded)
Step 1 : Launch VS 2010 and Add New Project Name :  KazWebSite, Type : Class Library
Step 2 : Do the library & framework Integration to run web driver( see my previous post) and add a class Named “TestTabKAZ” and add include those libraries in the class(my previous post)
Step 3: Now write assign class as Test Fixture
[TestFixture]

public class TestTabKAZ

Step 4 : Now , define WebDriver[we are using firefox, if you want, just change FirefoxDriver() it to InternetExplorerDriver()], Error logs, base URL



private IWebDriver driver = new FirefoxDriver();

private StringBuilder errors=new StringBuilder();

private string baseURL = "http://www.kaz.com.bd";

Step 5 : Define  TestFixtureTearDown that will run one time after full test execution(Unload related tasks). In here we are quitting the driver and providing a notification to NUnit UI by assert exception if there is any error listed in error logs.


[TestFixtureTearDown]

public void TeardownTest()

{

    try

    {

        driver.Quit();

    }

    catch (Exception)

    {               

    // Ignore errors if unable to close the browser

    }

    Assert.AreEqual("", errors.ToString());

}
Step 6: Define a test case to test Home Tab. In Home tab of the site , we will test
-Title is ok or not(checking by assert string compare)
-Links is present or not(checking by assert true)
-URL link ok or not(checking by assert string compare)
-Home link spelling is ok or not(checking by assert string compare)
and If any error occurs, we will store into Error logs.


[Test]

public void TestHome()

{

    driver.Navigate().GoToUrl(baseURL+"/index.html");

    try

    {

        Assert.AreEqual("http://www.kaz.com.bd/index.html", driver.Url);

        Assert.AreEqual("Home", driver.FindElement(By.LinkText("Home")).Text);//home link

        Assert.AreEqual("Kaz Software", driver.Title);//title ck

        Assert.IsTrue(IsElementPresent(By.LinkText("Home")));//element ck boolean      

    }

    catch (Exception ex)

    {

        errors.Append("\n-Home Error");

        errors.Append(ex.ToString());

        throw ex;

    }

}
Note : In here, to get the element , we use IsElementPresent. It is a private method. For that, add the following code that will use Driver to find element and use NoSuchElementException.



private bool IsElementPresent(By by)

{

    try

    {

        driver.FindElement(by);

        return true;

    }

    catch (NoSuchElementException)

    {

        return false;

    }

}

Step 7 : Like as home tab, add test cases for “Talents”, “Culture”, “Contact” and finally the code will be like this


using System;

using System.Text;

using System.Text.RegularExpressions;

using System.Threading;

using NUnit.Framework;

using OpenQA.Selenium;

using OpenQA.Selenium.Firefox;

using OpenQA.Selenium.Support.UI;

using OpenQA.Selenium.IE;

 

namespace KazWebSite

{

    [TestFixture]

    public class TestTabKAZ

    {

        private IWebDriver driver = new FirefoxDriver();

        private StringBuilder errors = new StringBuilder();

        private string baseURL = "http://www.kaz.com.bd";

        

        [TestFixtureTearDown]

        public void TeardownTest()

        {

            try

            {

                driver.Quit();

            }

            catch (Exception)

            {

                // Ignore errors if unable to close the browser

            }

            Assert.AreEqual("", errors.ToString());

        }

        [Test]

        public void TestHome()

        {

            driver.Navigate().GoToUrl(baseURL + "/index.html");

            try

            {

                Assert.AreEqual("http://www.kaz.com.bd/index.html", driver.Url);

                Assert.AreEqual("Home", driver.FindElement(By.LinkText("Home")).Text);//home link

                Assert.AreEqual("Kaz Software", driver.Title);//title ck

                Assert.IsTrue(IsElementPresent(By.LinkText("Home")));//element ck boolean

            }

            catch (Exception ex)

            {

                errors.Append("\n-Home Error");

                errors.Append(ex.ToString());

                throw ex;

            }

 

        }

        [Test]

        public void TestTalents()

        {

            driver.Navigate().GoToUrl(baseURL + "/talent.html");

            //driver.FindElement(By.LinkText("Talents")).Click();

            try

            {

                Assert.AreEqual("Kaz Software - Talents", driver.Title);

                Assert.AreEqual("Talents", driver.FindElement(By.LinkText("Talents")).Text);

                Assert.IsTrue(IsElementPresent(By.LinkText("Talents")));

                Assert.AreEqual("http://www.kaz.com.bd/talent.html", driver.Url);

            }

            catch (Exception ex)

            {

                errors.Append("\n-Talents Error");

                errors.Append(ex.ToString());

                throw ex;

            }

        }

        [Test]

        public void TestCulture()

        {

            driver.Navigate().GoToUrl(baseURL + "/culture.html");

            //driver.FindElement(By.LinkText("culture")).Click();

            try

            {

                Assert.AreEqual("http://www.kaz.com.bd/culture.html", driver.Url);

                Assert.AreEqual("Kaz Software - Culture", driver.Title);

                Assert.IsTrue(IsElementPresent(By.LinkText("Culture")));

                Assert.AreEqual("Culture", driver.FindElement(By.LinkText("Culture")).Text);

            }

            catch (Exception ex)

            {

                errors.Append("\n-Culture Error");

                errors.Append(ex.ToString());

                throw ex;

            }

        }

        [Test]

        public void TestContact()

        {

            driver.Navigate().GoToUrl(baseURL + "/contact.html");

            //driver.FindElement(By.LinkText("contact")).Click();

            try

            {

                Assert.AreEqual("http://www.kaz.com.bd/contact.html", driver.Url);

                Assert.AreEqual("Kaz Software - Contact", driver.Title);

                Assert.IsTrue(IsElementPresent(By.LinkText("Contact")));

                Assert.AreEqual("Contact", driver.FindElement(By.LinkText("Contact")).Text);

            }

            catch (Exception ex)

            {

                errors.Append("\n-Contact Error");

                errors.Append(ex.ToString());

                throw ex;

            }

        }        

        private bool IsElementPresent(By by)

        {

            try

            {

                driver.FindElement(by);

                return true;

            }

            catch (NoSuchElementException)

            {

                return false;

            }

        }

    }

 

}
Step 8 : Now, build the solution (F6) [Don’t Run by F5 as it is not a executable project and it may show error message]

Step 9 : Open NUnit from Program file , Click Open Project and go to the stored location of the solution of VS project. Open Debug Folder.
image

Select the DLL named TestTabKAZ.dll
image

And Press Open.

Step 10: We will get NUnit GUI loaded with the project that we build. Please see the test cases that should be shown in GUI.
image

Step 11 : Running the Tests. We can run all tests together by selecting the Test Fixture and click Run or we can select an individual test case and Run the test.

If there is any Error, the NUnit GUI will show up with Error like this mentioning the text and which line the error occurs with the expected and actual values.  image

In , we have found the error with RED Bar mentioning error on line 100 as Expected the URL as cultural page where actual was contact page. From the code you can see , this occurs due to contact page load time delay for the Google Map present in contact page. These are real life issues. It may occur though you have written proper test cases. Now, from code , if we check URL at the last so that the page get time to be loaded, this error may not occur. And, its really is

image

We just change the following test part of culture.[testing URL at the end of other tests]


Assert.AreEqual("Kaz Software - Culture", driver.Title);

Assert.IsTrue(IsElementPresent(By.LinkText("Culture")));

Assert.AreEqual("Culture", driver.FindElement(By.LinkText("Culture")).Text);

Assert.AreEqual("http://www.kaz.com.bd/culture.html", driver.Url);

For the page load time, we may use time tracking code to measure load time and define failure cases for performance issues. In here, it will fail for a page if the time is more than 60s.




if (second >= 60) 

   Assert.Fail("timeout");

Now, we run an individual test case . Select TestHome and Run and see the results .

image

Here, the test pass with Green Bar.

So, In this small article, we have seen how to test simple tabs for a webpage. This part’s JAVA will be posted soon.

Thanks for staying with me….:)