Transformation from Manual tester to a Selenium WebDriver Automation specialist !!!
RSSS

A Small guide for a tester transformation into a WebDriver scripter


 This table will be very useful for a selenium beginner who is trying out selenium WebDriver

WebDriver Commands Category

 

Tasks Human Interaction (Manual Tester) WebDriver Commands
Invoke Browser Tester manually opens the browser Firefox, IE, chrome or Safari
WebDriver driver=new FirefoxDriver();
WebDriver driver=new SafariDriver();
WebDriver driver=new chromeDriver();
WebDriver driver=new InternetExplorerDriver();

This is actually a WebDriver object instantiation and
this will invoke the browser according to different
WebDriver implementation.

Load URL of Application Tester manually type’s in the URL

http://www.google.com

driver.get("http://www.google.com");

Loads the given url into the browser

Click Tester clicks on the Search field in the Google home page
driver.findElement(By.cssSelector("#gbqfq")).click();
driver.findElement(By.cssSelector("#gbqfq")).clear();

Click actually comes with clear command in WebDriver.
Clear command will simply clear the input field. Basically
to avoid the auto-form fill.

Type Tester types the words manually
driver.findElement(By.cssSelector("#gbqfq")).sendKeys("test");

Types “test” into the input element identified by css selector.

Select from Drop-down Tester clicks on the Drop-down field and selects the required option
Select select = new Select(driver.findElement(By.tagName
("select")));
select.selectByVisibleText("Apple");

Selects the text
displayed as “Apple” in the select combo box which
is identified by tag name “select”

Moving between Windows Tester will simply click on the window or will do a Alt+tab combination to toggle between windows
driver.switchTo().window("windowName");
driver.switchTo().frame("frameName");

We can switch between frames or iframes using above command.

Alert Handling Tester knows that Alert will be pop-up and then asserts it.
driver.findElement(By.xpath (“<Xpath>”)).click();
Alert alert = driver.switchTo().alert();
alert.accept();

Note : Alert provides methods like accept(), dismiss(),  getText().

Browser forward/back button Tester will be clicking on the browser back and forward button
driver.navigate().forward();driver.navigate().back();

Navigate back and forth in the browser

Drag and Drop Tester uses the mouse movement and drags the element to destination and drops it.
WebElement source = driver.findElement(By.name("source"));
WebElement target = driver.findElement(By.name("target"));
(new Actions(driver)).dragAndDrop(source, target).perform();

Performs the drag from source to target.

Mouse Hover Tester just places the mouse over the element
Actions builder = new Actions(driver);
WebElementtagElement =
driver.findElement(By.id("someid"));
builder.moveToElement(tagElement).build().perform();

Simulates the mouse hover on the element identified by id.

Check/UnCheck Tester performs this manually using mouse on the specific check boxes
WebElement checking =
driver.findElement(By.name("your locator by name"));checking.click();
System.out.println(checking.isSelected());

Performs Check/Uncheck of the check box identified by name

Select Radio button Tester performs this manually using mouse on the specific Radio button
WebElement radiogender = driver.findElement(By.xpath("//input[@name='male']"));         radiogender.click();
System.out.println(gender.isSelected());

Selects the radio button identified by name as ‘male’

AssertElementPresent Tester checks whether the element is displayed
assertTrue(isElementPresent(By.xpath("Some xpath")));

Checks whether element identified by XPath is present in the webpage or not.

Extract some Text from Application Tester just use the copy paste command
String gettingtext =
driver.findElement(By.xpath("some xpath")).getText();

Gets the text of the element identified by xpath.

Submit a form Tester just clicks on the submit button on page
driver.findElement(By.id(“your locator by id”)).submit();

Submits the form identified by id.

Hope this will help a selenium beginner, please leave your comments if any and do share

49 thoughts on “Transformation from Manual tester to a Selenium WebDriver Automation specialist !!!

  1. November 5, 2012 at 12:50 am

    Magnificent goods from you, man. I have understand your stuff previous to and you’re just too great. I actually like what you have acquired here, really like what you’re stating and the way in which you say it. You make it entertaining and you still care for to keep it smart. I can’t wait to read much more from you. This is actually a wonderful web site.

    1. November 5, 2012 at 2:36 pm

      Thanks for your kind words Vanesa Delgado.

  2. Ashly Suet
    November 15, 2012 at 10:05 pm

    Awesome info and well written. Keep up the good stuff!

    1. November 16, 2012 at 9:07 am

      Thanks a lot.

  3. November 20, 2012 at 6:35 pm

    Hi,
    its really a very good article for starters like me.
    Thank you very much, keep gooing

    1. November 20, 2012 at 6:38 pm

      I am glad it helps you. Keep visiting the blog for more posts.

      1. November 5, 2013 at 2:42 pm

        Hi

        Can you support me with remote project support

  4. Suresh
    December 2, 2012 at 9:53 pm

    every one can understand this…very well explained…

    1. December 2, 2012 at 10:05 pm

      Thanks Suresh. Its made for beginners..!!!

  5. Richa
    December 12, 2012 at 11:25 am

    Good check list, very useful for beginners.
    Thank u

    1. December 12, 2012 at 11:40 am

      Thanks for your kind words. http://facebook.com/AssertSelenium pls give a Like and publicize amongst your friends.

  6. Hariharan M
    December 20, 2012 at 11:07 am

    Awesome Post, really helpful for beginners in selenium..

    1. December 20, 2012 at 11:18 am

      Thanks Hariharan

  7. Geeta Chaudhari
    December 27, 2012 at 3:14 pm

    Hi,
    This is really helpful.

    Just a small request – Can you please explain when/why/which cases do we use JavaScriptExecutor in WebDriver?

    -Geeta

    1. December 27, 2012 at 3:46 pm

      Hi Geeta,
      Good Question.

      There are some times, when the tool doesn’t perform what we wanted to do exactly.
      Example: sometimes the tool has not interacted with a page correctly, [or] has failed to react when an XmlHttpRequest returns [or] it hasn’t emitted the correct events.

      So, at this situation using the JavaScriptExecutor will be a handy workaround.

      Hope that helps.

      1. Suresh
        December 27, 2012 at 3:49 pm

        hi manoj,
        can u pls share with us an example scenario , so that we can understand better..
        thank you.

        1. December 27, 2012 at 4:03 pm

          Well, this is based on any particular scenario where the Selenium or WebDriver could not interact on any element in a webpage
          In Selenium RC : we used getEval() API
          In WebDriver we are using JavaScriptExecutor

          I will have to search for that functionality where it cannot interact. let me see whether I can make it as blog post itself.
          Thanks

  8. Mayur. J
    January 7, 2013 at 4:43 pm

    Really useful, thanks a lot… was searching for a list like this from a loong time, finally i found this from you.. keep going..and add more n more tuts for QA begenners. -God bless !!

    1. January 8, 2013 at 12:30 pm

      Thanks Mayur, I am glad its helpful for you.

  9. swa
    January 18, 2013 at 12:03 pm

    very useful commands,really appreciate for your knowledge sharing

    1. January 18, 2013 at 12:05 pm

      swa,

      thanks, hope you have subscribed and Like’d the page at FB

  10. ranjithkumar
    February 26, 2013 at 11:38 am

    awesome work .. really interesting and helps a lot beginners like me..thanks a lot..and plz keep post some advanced topics too..

  11. February 26, 2013 at 7:14 pm

    It has really helped me a lot….. very well explained.. :)

  12. Sush
    March 21, 2013 at 5:33 pm

    Brilliant ! Indeed very helpful! Keep posting more links :) as we are moving to next phase from Beginners!

    1. March 21, 2013 at 5:37 pm

      Oh.. That’s great. Like your confidence on moving to next phase :) Keep visiting.

  13. Prasanth
    March 25, 2013 at 2:44 pm

    Hi manoj, very great work frm u, i just came across some useful selenium blogs,inorder to suggest to new selenium learners, and ur contents are really superb and its easy to understnd for new selenium learner……Keep updating manoj

  14. venkatesh
    May 15, 2013 at 1:43 pm

    Nice blog regarding selenium, i am planning to learn selenium can u please share related documents to following mail id : tativenky@gmail.com.

    1. May 16, 2013 at 10:50 am

      There is nothing to be emailed as a study material, all you can do is Go through the Selenium documentation and try it on your own and if you struggle anywhere look for blog posts like this. You will be good at Selenium scripting.

  15. Venkatesh
    May 17, 2013 at 9:38 am

    Daily 2hrs enough for learning selenium ? if yes, total how many months ll take to reach medium level.

  16. Amit goyal
    May 19, 2013 at 9:26 am

    this is extremely good. This is very helpful for beginner. should also explain some more controls like list control, date picker control and the different ways of identifying the elements.

  17. Rama
    May 22, 2013 at 6:41 am

    Really very helpful, Looking for advanced topics …. thank you for the information,

  18. Hari
    August 9, 2013 at 9:24 am

    Wonderful and an very interesting link for a newbie. Looking forward for an advanced level.

    Keep rocking !!!

  19. Madiraju Krishan Chaitanya
    August 14, 2013 at 5:05 am

    Hi Manoj Kumar,
    First of ALL… I would like to Thank You for the wonderful article.Thanks a LOT.For beginners like us,this website is very handy and easy to understand.Please do keep posting articles on Selenium(IDE and WebDriver) and Core Java too.You can add me to your Fans List… ;-).

    1. August 14, 2013 at 7:13 pm

      Hi Madiraju Chaitanya,
      Thanks for your kind words.

      Cheers-Manoj

  20. Mayur Bhatia
    September 11, 2013 at 10:56 am

    Thanks. Keep up the good work. God bless :)

    1. Mayur Bhatia
      September 11, 2013 at 11:09 am

      I have a question regarding the radio buttons, ie

      If we want to check whether the radio button we selected is there or not….what code should i follow?

      1. September 19, 2013 at 6:43 am

        boolean radiobtn = driver.findElement().isEnabled();
        Valdiate using the boolean value returned.

  21. Manas Hardikar
    September 12, 2013 at 9:45 am

    I am a beginner to Selenium web driver and this is exactly what i needed…
    Great work thankyou..!!!!

  22. purusottam
    October 5, 2013 at 8:32 am

    Hi ,
    i am also beginner and i have a question that i wanna make automation test for register page and register page content captcha code and we know it’s come every time diffrent so i want when script run than it’s ask me for give captcha manually after come in scrpit and complete automation script , is it possible or do you know another way please let me know .
    Thanks

  23. Kaka
    December 10, 2013 at 8:09 pm

    assertTrue( (By.xpath(“Some xpath”)));

    do we have put the path in
    assertTrue( here??? (By.xpath(“Some xpath”)));

  24. anna parker
    December 22, 2013 at 9:39 am

    Hi ,
    i am also beginner and i have a question that i wanna make automation test for register page and register page content captcha code and we know it’s come every time diffrent so i want when script run than it’s ask me for give captcha manually after come in scrpit and complete automation script , is it possible or do you know another way please let me know .
    Thanks

    1. December 23, 2013 at 7:12 am

      Its a common problem and already many had. Commented on the same issue. So there is nothing that I can suggest new
      Thanks

  25. Deepthi gowda
    January 9, 2014 at 4:40 am

    Hi ,
    Its really very helpfull for QA starters and my request is can u pls provide some example scripts to keep on moving .

    Thanks lot

    1. January 9, 2014 at 8:13 pm

      Hi Deepthi,
      Pls provide more information on what you exactly looking for. Email me at manojk@assertselenium.com

  26. February 1, 2014 at 5:43 am

    Really Appreciate Your efforts. Thanks a lot :)

  27. surya
    February 1, 2014 at 10:59 am

    How to set up a no proxy option for Firefox browser using selenium script

  28. manoj nel
    February 17, 2014 at 11:53 am

    Hi,

    Thanks for your information. It is verify useful for beginners.
    I have few queries regarding ruby with webdriver.

    1. I installed selenium webdriver with ruby.
    2. Which tool is best for writing the code using ruby webdriver?
    3. Where we can get the webdriver methods to write the code?
    4. Any tool which is best to write code using ruby webdriver , will it show any information about supported operations for that particular object like QTP. pls look into screenshot.

    Kindly provide the information about these queries. Thanks in Advance.

    If it is possible pls provide the full information about ruby with webdriver.

  29. manoj nel
    February 17, 2014 at 11:57 am

    sorry i could not post screenshot here.

    Browser(WebBrowserDesc).Page(WebPageDesc).WebElement(WebObjdesc).

    after “. ” it will show the operations. like Click,set,Exist,GetROProperty…….etc

    hope u got my question clearly…

  30. VVV
    March 20, 2014 at 1:04 pm

    Good

Leave a Reply

Your email address will not be published. Required fields are marked *