Q1-What is Automation Testing

Answer- When you talk about Software testing or Quality assurance of any product it means we have to deliver our application bug free it means no defect in our application. In order to achieve quality we perform testing in our application it means we perform several test case it can be functional test cases and nonfunctional test cases also.

In order to save our time and resource we can automate manual test cases, which save human effort and time as well.

Scenario – If we need to test same scenario 100 times manually and each time we are checking the same result then better to automate this test case and run it number of times and verify the result.

We have different tools available in the market, which gives us the liberty to automate our application

 

Q2- When Automation testing should be performed?

Answer- We can perform automation testing in our day to day testing activities it means when we have to execute some test case on regular basics then better to automate that test cases

Majorly we perform automation testing for regression testing, smoke testing and sanity testing as well.

Scenario- If you have 50 scenario that you have to execute on daily basis and you will be testing the same scenario for next couple of releases as well then manually running these test cases will be tedious task so here you can adopt automation testing.

 

Q3-Which test case cannot be automated?

Answer-

1-This is very important and interesting question as well that which test cases cannot be automated, my answer is you should avoid test cases which is changes very frequently it means even if you will automate that test case next time it will fail because application feature will change so better to choose test case which is stable.

2- We should not automate test cases which has manual interaction like enter authorization code, capcha code etc.

Selenium introduction
Answer- Selenium is Open source Web Automation tool which was designed by ThoughtWorks in 2004, It started by Selenium IDE then Selenium RC which is also known as Selenium 1 then Selenium Webdriver which is also known as Selenium 2

Selenium is very popular now days because of many reasons

  • It is open source tool, which means we do not have to purchase any license for this. We can download from their officially website and we can use.

 

  • It support many languages like Java, Java Script, C#, Python, Ruby etc.

 

  • We can perform cross browser testing as well. Selenium Webdriver support almost all browser which their latest version like Firefox, Chrome, IE, Safari, Opera etc.

 

  • It support the entire platform like Windows, UNIX, Linux, Apple etc.

 

  • Recently Selenium has introduced mobile testing as well, now we can automate Android testing using Selendroid, IPhone testing using appium and many more.

 

  • Selenium having compatibility with many tools well some example are AutoIT, Jenkins, Sikuli, Testng, Junit etc.

 

 

87 thoughts on “Selenium introduction

  1. rajeswari says:

    Hi Mukesh,
    how to get diasabled dropdown value using selenium

    1. Hi Rajeswari,

      It depends on which kind of control web developer has used. If you are able to see select tag then you should be able to see all values with option tag or if it is select2 or any other type of control which contains ul, li, div tags then it is difficult to get those options.

  2. Rajendra says:

    Hi mukesh, I am using data driven framework locators and data are reading from excelsheet. If I want to click share link it gives four icons like facebook, linked in, Google plus and Twitter I want to share image with all four social media how to write code. If I click facebook it I’ll open new tab then I want perform operation and share data it comes back share page.same for linked in and twitter and googleplus

    1. Hi Rajendra,

      If you are dealing with Selenium which only works with Web UI then you what you can do manually same can be achieved through Selenium also because it fully depends on UI. But if you don’t want to use Selenium Ui then you have to deal with API of corresponding application.

  3. Vinotj says:

    Hi I need check the 50 url at a time and share the active and inactive url to the mail can you help to how to proceed

  4. Ritesh says:

    Hi Mukesh,
    Need your help.
    I want to do click operation on image link and here is the HTML Code. Want to do using Selenium Webdriver in python. Please suggest:-
     

    1. Hi Rithesh,

      You might be able to see img tag, try to click on it.

  5. sagar says:

    Hi,
    First a big thanks to you for such amazing conceptual videos.
    I have one problem,
    I am working on dataDriven F/w and accessing test inputs from exelSheet , after each entry it will quit my browser but i am not able o continue my browser after test passed.
    how can i continue with same page after test passed

    1. Hi Sagar,

      Please debug your code to check error/exception.

  6. deepak says:

    Hi Mukesh,
    I am getting error while opening the chrome.
    Invalid port. Exiting…
    ?????? ??, ???? ?:??:?? ????????? org.openqa.selenium.os.OsProcess checkForError
    SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    Exception in thread “main” org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
    Build info: version: ‘3.9.1’, revision: ’63f7b50′, time: ‘2018-02-07T22:42:22.379Z’
    System info: host: ‘HP’, ip: ‘192.168.1.9’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
    Driver info: driver.version: ChromeDriver
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192)

    1. Hi Deepak,

      Which chromedriver version are you using?

  7. sreehari says:

    this is error how to solve this

    Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
    at com.google.common.base.Preconditions.checkState(Preconditions.java:754)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
    at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:41)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:141)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339)
    at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:158)
    at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:120)
    at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:98)
    at sr.ha.main(ha.java:9)

    error

    this wer driver fire

  8. swaraj says:

    Hello,
    If i have 2 autosuggestion boxes of same name, after using that for ‘from’ field, not able to use the same and select from auto suggestion for ‘To’ Filed. site is redbus.com. Can you please help me?

    1. Hi swaraj,

      Kindly use dynamic xpath to locate From and To fields. Please check this link for more info https://vistasadprojects.com/mukeshotwani-blogs-v3/how-to-write-dynamic-xpath-in-selenium/

  9. Shantanu Devkar says:

    Hi..Mukesh Othwani Sir,

    Selenium support to all latest browser, this is advantage of selenium. But i have tried, it is not supported. I have used 2.53 version of selenium jar in my project and ran on 56.0 latest firefox Browser. But it is not supported….so, what should I do…How to resolve this issue.

    1. Hi shantanu,

      Use FF 46.0 with Selenium 2.53.1. In order to work with latest FF, you need to migrate to Selenium 3.6.0 version which uses gecko driver. Latest chrome with latest chromedriver works anyway.

  10. Kumar says:

    I have one scenarios
    there is submit button on registration page . you on that button. while you navigate to the next page take a longer time to load, as site is heavily loaded with request . you need to handle this loading and validate the text in screen “You have successfully registered”.

    1. Hi Kumar,

      Use Fluent wait. You need to set maximum time limit an keep on waiting for required message using this fluent wait. For more details check this link https://vistasadprojects.com/mukeshotwani-blogs-v3/fluentwait-in-selenium-webdriver/

  11. Mandar says:

    How we can find our case is failed due to your’s 5 things like network failure…….in testng or selenium. Also hot to handle these type of cases

  12. hema says:

    hi,
    I Have One scenario To Capture image from webcam.
    manually i didnt get any browser popup but while running script when i clicked on webcam button browser popup coming for “share Selectedlocation” .how to handle this .please help me.

    1. Hi Hema,

      If it is web based pop up then directly use Selenium otherwise try with AutoIT or robot class to avoid pop up.

  13. Parthasarathi Tripathy says:

    Really your videos and explanation is helpful for learning Selenium. Thanks for your effort and presentation which helps me a lot to learn Selenium Automation as i am new to this.

    1. Hi Parthasarthi,

      Thanks for your review. keep visiting my blog and also keep learning.
      Be in touch…

  14. hema says:

    Hi ,
    Can u give clear explnation about wait commands .
    And in which case we need to use those commands.

  15. RANJAN V says:

    Nice.

    1. Hey Ranjan,

      Thanks for your comments..:)

  16. shailendra says:

    Hi Mukesh Otwani,
    How we execute the java program in Jenkins on mac ?
    Please tell me the step by step configuration step

  17. Gangadhar Wali says:

    Hi Mukesh,
    Thanks for your wonderful work.

    My web application is in remote desktop, please assist me how to connect to remote desktop using selenium,

    Regards
    Wali

    1. Hi Wali,

      If your jenkins server is possible to get connect to that remote then make it as Slave/Node and execute through Jenkins or else go for Selenium Grid.

  18. udit says:

    sir i don’t know about selenium plz suggest me step by step video from the basic selenium topic wise.

    1. Hi Udit,

      Please start from this link

      1. udit says:

        thank you sir, I have a more question which eclipse is best for selenium testing

        1. Hi Udit,
          You can use eclipse latest version based on your system architecture (32Bit or 64Bit)

  19. Ashwary says:

    Hi Mukesh,
    Please help me …exactly at this point i m stucking from long tym…..plz help ….why this “Element not found” exception always comes.
    My Mail-id:-tehiboy6@gmail.com

    org.openqa.selenium.NoSuchElementException: Unable to locate element: {“method”:”xpath”,”selector”:”html/body/div[1]/aside/section/ul/li[4]/a”}
    Command duration or timeout: 85 milliseconds

    1. Hi Ashwary,

      Please use fluent wait to handle this situation, more info on this link https://vistasadprojects.com/mukeshotwani-blogs-v3/fluentwait-in-selenium-webdriver/

    2. Hi Ashwary,
      Use Fluent wait to handle this.

  20. sonali pradhan says:

    Hi Mukesh I am not getting the code for broken links in your website that is learn-automation.com. where I can find that. Can you suggest me how to detect unreachable pages in selenium webdriver

  21. kalpesh Patil says:

    Hi Mukesh,
    How can I use single login script, if I pass ID of webElement or Xpath of webElement ??

    1. Hi Kalpesh,

      Create a separate class for login. Provide parameters from testng xml file or pass these parameters from your main test method.
      There are lot of other ways too.

  22. Leo Lowranse says:

    Hi Mukesh,
    Your videos and posts are really helping me a lot to pace up with Selenium Automation.
    Keep up the good work dude. 🙂

    Regards,
    Leo Lowranse

    1. Hi Leo,

      Thanks for your pleasing feedback. Please be in touch with learn-automation…:)

  23. Priya says:

    Hi Mukesh,
    How to handle dynamic web table in selenium webdriver?

  24. Ash says:

    Hi sir,
    please guide me,how to start with frame work.I am working for social networking site,just like facebook.Its a big project.

    1. Hi Ash,

      If possible the proceed with Page Object Model using PageFatory mechanism. Please visit this link https://vistasadprojects.com/mukeshotwani-blogs-v3/page-object-model-using-selenium-webdriver/

  25. Imraz Ansari says:

    Sir I want know how to enter the password in gmail through xpath

    1. Hi Imraz,

      Xpath -> //*[@type=’password’] & sendKeys()…simply works here. The xpath which i mentioned is one way but there are lot of other ways too.

  26. Sneha says:

    Hi mukesh will u please send me any link like registration page using TestNG. i am selenium beginner . I learn lot much things from your videos thanks mukesh . you are best.

    1. Hi Sneha,

      You can use link for your practice stuff https://orangehrm-demo-6x.orangehrmlive.com/

  27. Vinoth says:

    Hi Mukesh,
    I need to clarify one doubt, how can upload the image using robot for mac users but there is no text box??

  28. Prashant says:

    Hi Mukesh
    I have one question
    How to count how many number of rows and columns in our web page in selenium webDriver?

    1. Hi Prashant,

      Check this with dynamic xpath. Check //table then look for tr and td tags.

  29. Dipesh Raul says:

    Hi Mukesh,
    Happy to say that Your videos are very Helpful to learn automation testing using selenium.
    Could you please post the videos on contineous integration(CI) and contineous Deployment(CD) using jenkins or any using any other tools?

  30. Priya says:

    Hi Mukesh,

    How to handle an error that may happens anytime in any of the page ..

    1. Hi Priya,

      Errors are not recoverable but Exceptions can be handled. And in order to handle exceptions, you must must aware of kind of exception which may occur.

  31. shardha sharma says:

    Hi Mukeash,
    M facing an issue while running the script.
    Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
    from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
    (Session info: chrome=57.0.2987.133)

    1. Hi Shardha,

      It looks like you have run your automation script in chrome browser. Please update your chromedriver to atleast 2.28 version.

      1. shardha sharma says:

        Thank you….Mukesh….
        I updated & its working now….
        And your videos & blog is very helpful to us to learn selenium….
        Can u plz tell me … how to prepare for the selenium interviews & can share the interview question too..
        Thanks

        1. Hi Shardha,

          Happy to read from you. There is no specific way to prepare for automation interviews as each interviewer would be having their own perspective. More and more you explore, more you will learn. I’ve posted few questions from my side, link for same is here https://vistasadprojects.com/mukeshotwani-blogs-v3/selenium-interview-questions-and-answers/

  32. Syed Hashmi says:

    Hi Mukesh,
    Your videos and posts about automation are very fruitful appreciate your work

    1. Hi Syed,

      Very thanks for your overwhelming comments. Keep commenting your doubts, I’ll try my level best to clarify.

  33. piyush says:

    Hi Mukesh,

    I would like to Know, as an automation engineer should we decide , that this application is best for automation testing not manual testing? Say, when the client really doesn’t have much clear idea about requirements and if there is a sprint release after every 2 weeks?

    1. Hi Piyush,

      It is quite tough to explain these kind of circumstances. Automating any application not only depends of coding knowledge, it also requires functional knowledge of an application. Again it includes the way UI has been designed. Usually automation of an application is carried out for regression testing not for application which is still under development. Here functionality also matters a lot because if functionality is too big then scripting also takes lot of time. Finally the selection of framework and reporting. In my opinion, you should consult any senior member of your organization who should have know how of development.

  34. Ajay says:

    Hi mukesh..!
    Your site is providing good knowledge for freshers and also kindly update the tutorial about Testng,maven,Pom,Modular driven Frameworks pleaw

    1. Hi Ajay,

      Thanks for your constructive comment…:)

  35. lavanya says:

    Hi
    UI testing is possible in automation

    1. Hi Lavanya,

      Yes, this is what Selenium does

  36. Aishwarya Chaudhary says:

    Hii Mukesh
    Thank you so much for your solution.

    1. Thanks Aishwarya…:)

  37. Mohinni says:

    Hats off to your hard work Sir.You have explained each and every topic in detail.It’s helping me learning selenium.

  38. Pranshu says:

    Hey Mukesh,

    Amazing stuff, thanku

    1. Hi Pranshu,

      Thanks for your comments.

  39. Sidhu says:

    Awesome Mukesh nicely presented
    Can you share ALM and Selenium Integration

    1. Hi Sidhu,

      I have not tried ALM with Selenium 🙁

  40. Mohanraj says:

    Mukesh, your site rocking and its very useful for me. keep posting

    1. Thanks Mahanraj. Keep visitng and let me know if any help required from my side.

  41. Sibyl says:

    This website is really interesting. I have bookmarked it.
    Do you allow guest post on your site ? I can provide hi
    quality posts for you. Let me know.

    1. thanks Sibyl. Yes I do allow guest post 🙂 I would be happy if you can contribute some quality post.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.