Friday, November 17, 2017

Advanced Selenium Webdriver Interview Questions and Answers in Java

Advanced Selenium Webdriver Interview Questions and Answers in Java

Selenium WebDriver - QA

Here is the list of Selenium Interview questions and answers.


How to read data from table? 

You can easily read the data from table using findElements method. 
Find all the table cells using TD tag and then get the text inside each cell by getText() method or innerText property in HTML DOM.

What all browsers and OS are supported by Selenium? 

Selenium supports below browsers.
  1. Internet Explorer
  2. Google Chrome
  3. Firefox
  4. Safari
  5. Opera
  6. Android browser
  7. iPhone Browser
Operating systems supported by Selenium are -
  1. All Windows OS
  2. Linux
  3. Mac (Apple OS)
  4. Android
  5. IOS
Various Synchronization methods in Selenium Webdriver - implicit wait, 
page load timeout, explicit wait?
There are 4 ways we can handle synchronization in Selenium.
  1. Implicit
  2. Explicit using wait and expected conditions
  3. Browser Navigation timeout
  4. Script time out 
How to take screenshot in Selenium? 
Selenium provides an interface called TakesScreenshot which has a method getScreenShotAs which can be used to take a screenshot of the application under test.

How to execute JavaScript in Selenium? How many arguments 
can be passed to executeScript method? 
Selenium webdriver API provides one interface called 
JavascriptExecutor with a method called executeScript. 
This method has 2 main arguments. 
First argument is the javascript code you want to execute on current page and second argument is optional but important. 
We can pass variable number of web elements as an arguments which can be manipulated in javascript code passed in the first argument.

How to handle multiple browser windows and frames?
We can easily work with multiple windows and frames by switching to them. 
We can find all open windows in selenium using getWindowhandles method. 
We can find frame in the web page using name, id or any other method like css or xpath selectors.

How to drag and drop in Selenium Webdriver? 
Selenium webdriver provides Actions class which has many methods to support complex user actions like contextClick, doubleClick, dragAndDrop. 

How to use Selenium Grid?
Selenium grid is used to execute selenium scripts on various environments (OS and browsers) simultaneously and on different machines. 
Hub acts as a central server which sends the execution requests to the other machines called as nodes. 
Hub server and node server must be up and running. 
Node machine must be registered with HUB. Depending upon the webdriver capabilities, HUB routes the request to appropriate node to execute the scripts.

Challenges, issues and limitations of Selenium tool? 

How to handle Captcha? 
We can not handle captcha in Selenium. We can not also automate 
the Adobe Flash contents on webpages. These are some of the limitations of Selenium.
Other common issues are -
  1. Certificate Errors in IE
  2. Protect mode error
  3. Browser zoom error in IE
  4. Canvas image map
  5. Unsupported command line flag - ignore certificates warning in Chrome
What is the page object model in Selenium? 
Page object model is an alternative way to handle automation project.

Write a complex xpath or css expression? Which one is better? 
xpath and css can be used to find any element on the web page.
 Most of the engineers prefer writing xpath expressions as finding r
elative elements is very easy in xpath.

How to upload files using AUTOIT Script, Robot?
We can use AUTOIT/Robot/Sikuli code to handle the window dialogs 
which are not supported by web driver.

Flash automation, silverlight Automation? 
Selenium has no support for these controls. We need to use third party tools to automate these apps.

How to format date and time in Selenium in Java? How to compare dates? 
We can format date in selenium using DateFormat object.

How to append a data to file in Selenium?
We can use File and FileWriter class to work with files in Selenium Webdriver.

Frameworks in Selenium - Data driven, Hybrid, Keyword, 

BDD - Cucumber, TestNG?
Frameworks are used to speed up the automation testing by 
developing the test data, reusable functions and reports.

Database testing in Selenium? 
We can use JDBC driver to connect to any database in Java.

How to work with Excel files in Selenium?

We can use JXL or POI library to work with excel files in Selenium.

Find total time of execution in Selenium? 
If we are using custom library, we can log the start and end time 
of the execution and then find the total execution time by 
subtracting end time from start time.

How to schedule the Test Suite Execution?
We can schedule the test suite execution using CI tools like 
hudson(Jenkins), Bamboo. Alternatively, we can use windows 
scheduler to launch the test execution.

How to send an email stating the execution status to all stakeholders in Selenium? 
We can send mail in Java using javax.mail library.

What is the difference between findElement and findElements?
findElement returns the first matching element. If element is not found, NoElementFoundException is thrown. findElements 
returns the list of matching web elements. 
If no element is found, empty list is returned. Exception is not thrown.

What is the difference between Junit and TestNG. What are the various annotations and features? 
TestNG is the new generation testing framework with lot of new 
useful features as compared to old Junit framework. 
Using TestNG, we can run the tests in parallel.

Automation of Android apps and Android Browsers using Selenium possible?

We can use  Appium and Selendroid tools to automate mobile applications.

How to handle Ajax calls in Selenium?
When working with Ajax calls, we must be very careful to handle StaleElementStateException. This exception occurs 
when we refer to the stale (Old) element on page. 
To handle this error, we need to find the element again after ajax load new elements in the page.

Difference between Selenium and QTP. Competitors to Selenium Webdriver? 
QTP is a licensed tool supporting automation of lot of applications based on .Net, Java, Web and much more. Selenium is a free tool and supports only web application automation testing.

What is desired capabilities?
Capabilities are used to set the values of the browser attributes 
before we launch any browser using selenium web driver.

Version control tools like SVN, GIT? 
We use version control tools like SVN to track the changes to 
the files in a project and work in collaboration.

Build tools - Ant, Maven? 
We use these tools to manage build activities for the Java project.

CI tools - Jenkin, Bamboo? 

These are continuous integration tools helping in quick 
deployment of applications, testing them and reporting the issues in the code before it is too late. 
It helps in getting the application into production quickly and with more quality confidence.

How to identify the frame which does not have Id as well as name? 

We can identify the frame using xpath or css selectors as well.

What is the alternative to sendkeys? 

We can use JavaScriptExecutor to work with html controls.

How to press TAB key in Selenium? 

We can press any keyboard key using Keys class.

What are the Exception that may occur in Selenium Webdriver 

Selenium may throw below exceptions.
  1. InvalidElementStateException
  2. StaleElementReferenceException
  3. ElementNotFoundException
  4. ElementNotVisibleException 

For any feedback, feel free to reach me. You can write to me at naveenanimation20@gmail.com

Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

94 comments:

  1. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

    software testing course in chennai

    ReplyDelete
  2. It is very useful information. It will help to improve my knowledge in Selenium. Thank you for sharing this awesome site.
    Selenium Training in Chennai | Selenium Training | Selenium Course in Chennai | Selenium Training Institute in Chennai

    ReplyDelete
  3. Excellent information with unique content and it is very useful to know about the information based on blogs.
    Java training in chennai

    ReplyDelete

  4. Yiioverflow presenting one of the best and high performance PHP framework. Fast, secure and extremely professionals are developing applications. We guide to implement mobile app development and SOA hybrid applications.Code in Nodejs, Angular,Ionic,ReactJS and Yiiframework.

    ReplyDelete
  5. I think this is the best article today. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.
    Java Courses in chennai

    ReplyDelete
  6. I wish to indicate because of you only to bail me out of this specific trouble. As a consequence of checking through the net and meeting systems that were not beneficial, I thought my life was finished.
    fire and safety engineering course in chennai

    ReplyDelete
  7. Thanks for sharing with us, This article gives more useful information to me. Great post keep updating.
    Regards,
    Selenium Training in Chennai

    ReplyDelete
  8. Woww Thank you for the amazing information u have shared. that was very useful for me. do share more information.

    Click the link to know more exciting information.
    Selenium Training in chennai

    ReplyDelete
  9. This content was very useful and informative. POst more information.
    You can also refer for more job related information

    Selenium Training and Placement

    ReplyDelete
  10. Wonderful post!!Thank you for sharing this info with us.
    Keep updating I would like to know more updates on this topic
    Very useful content, I would like to suggest this blog to my friends.

    Selenium training Chennai

    software testing selenium training

    ReplyDelete
  11. I have read your blog completely. It is very impressive one for all the viewers. Thanks for sharing this blog.

    selenium training in chennai

    ReplyDelete
  12. Nice post.Thank you so much for sharing.Yiioverflow is a web development company.We have well expert team in Angular JS, Ionic, Yii Framework, Node JS, Laravel, PHP, MySQL, and WordPress.If you want a developer visit.. https://yiioverflow.com/

    ReplyDelete
  13. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    selenium training in chennai

    ReplyDelete
  14. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
    HTML Training in Chennai

    ReplyDelete
  15. it is an awesome article.it is so informative and i can learn more about selenium.<a href="http://www.slajobs.com/selenium-training-in-chennai.php>best selenium training in chennai</a>

    ReplyDelete
  16. This article is very much helpful and i hope this will be an useful information for the needed one.Keep on updating these kinds of informative things... Nice article Thanks for sharing this article Wonderful information from this website Thanks !!!

    Embedded System training in Chennai
    PLC training institute in Chennai

    ReplyDelete
  17. Selenium testing training is the future of automation testing and there are several institutes across India which provide proper training. There are several institutes which provide Selenium Testing Training in Hyderabad.

    ReplyDelete
  18. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops Training in Chennai

    Devops Training in Bangalore

    Devops Training in pune

    ReplyDelete
  19. The Best Java Classes in Ahmedabad providing with Java classes and is the Leading Core Java J2EE Training Institute in Ahmedabad.
    Core Java training in Ahmedabad

    ReplyDelete
  20. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

    rpa training in Chennai | rpa training in pune

    rpa training in tambaram | rpa training in sholinganallur

    rpa training in Chennai | rpa training in velachery

    rpa online training | rpa training in bangalore

    ReplyDelete
  21. A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts read this.
    python online training
    python training in chennai

    ReplyDelete
  22. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
    java online training | java training in pune

    java training in chennai | java training in bangalore

    ReplyDelete
  23. Thanks for the information, Check the best Selenium Training in Chennai from Hope Tutors.

    ReplyDelete
  24. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

    selenium training in bangalore

    aws training in bangalore

    ReplyDelete
  25. UiPath Training in Bangalore by myTectra is one the best UiPath Training. myTectra is the market leader in providing Robotic Process Automation on UiPath
    ui path training in bangalore

    ReplyDelete
  26. Thanks for making me this article. You have done a great job by sharing this content in here. Keep writing article like this.

    Mobile Apps Training
    Mobile Apps Training in Chennai

    ReplyDelete
  27. Good informations It mayt be Helpfull for me thanks alot for sharing
    SAP SD Training From India

    SAP Security Training From India

    ReplyDelete
  28. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Best Splunk Online Training From India
    Best Dellboomi Online Training From India

    ReplyDelete
  29. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    Oracle Rac Training Videos

    AWS Training Videos

    ReplyDelete
  30. Amazing Article ! I have bookmarked this article page as i received good information from this. All the best for the upcoming articles. I will be waiting for your new articles. Thank You ! Kindly Visit Us @ Coimbatore Travels | Ooty Travels | Coimbatore Airport Taxi

    ReplyDelete
  31. Nice information thank you,if you want more information please visit our link selenium Online Training Hyderabad

    ReplyDelete
  32. Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.
    Selenium Interview Questions and Answers
    Javascript Interview Questions
    Human Resource (HR) Interview Questions

    ReplyDelete
  33. I have read your blog its very attractive and impressive. I like your blog Java online training Bangalore

    ReplyDelete
  34. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.

    angularjs Training in chennai
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    ReplyDelete
  35. Very well written blog and I always love to read blogs like these because they offer very good information to readers with very less amount of words....thanks for sharing your info with us and keep sharing.
    python course in pune | python course in chennai | python course in Bangalore

    ReplyDelete
  36. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    excel advanced excel training in bangalore | Devops Training in Chennai

    ReplyDelete
  37. Thanks for providing the information . The articles in your blog helped me a lot for improving the knowledge on the subject. Also check my small collection on this at selenium Online Training blog

    ReplyDelete
  38. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs online Training

    angularjs Training in marathahalli

    angularjs interview questions and answers

    ReplyDelete
  39. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again.. Machine learning training in chennai | block chain training in chennai

    ReplyDelete
  40. Great blog thanks for explaining about the selenium.
    I am currently doing my selenium training in velachery.I had no idea about the future of Selenium so can anyone guide me with the scope of Selenium?

    ReplyDelete
  41. This concept is a good way to enhance the knowledge.thanks for sharing. please keep it up selenium Online Training Hyderabad

    ReplyDelete
  42. Learn Excel and Advanced excel Training Course in Delhi, Noida and Gurgaon with Better Placement assistance. Call Now and Get Free Demo Classes here- -+91-9311002620, +91-11-40504400. More Information here-https://www.htsindia.com/Courses/Business-Analytics/adv-excel-training-course
    Advanced Excel Training Course in Delhi, Noida and Gurgaon
    Advanced Excel Training institute in Delhi, Noida and Gurgaon

    ReplyDelete
  43. I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.
    best nebosh course in chennai

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging......
    water level controller service in chennai |
    Automatic Controller for RO pump in Chennai |

    ReplyDelete
  46. This comment has been removed by the author.

    ReplyDelete
  47. This comment has been removed by the author.

    ReplyDelete
  48. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Best Travels in Madurai | Tours and Travels in Madurai | Madurai Travels

    ReplyDelete
  49. Good Article with useful information. Thanks for Sharing with us. Don't forget to Visit TIB ACADEMY - Best Selenium Training Institute in Bangalore

    ReplyDelete
  50. Selenium is the best tool available in the market to test web applications. It is high in demand as the tool can be used to work with multiple OS and browsers compared to other tools.
    Selenium Automation Training London

    ReplyDelete
  51. You are doing a great job. I would like to appreciate your work for good accuracy
    Regards,
    Best Devops Training in Chennai | Best Devops Training Institute in Chennai

    ReplyDelete
  52. Hello! Someone in my Facebook group shared this website with us, so I came to give it a look. I’m enjoying the information. I’m bookmarking and will be tweeting this to my followers! Wonderful blog and amazing design and style.
    nebosh course in chennai

    ReplyDelete
  53. Information from this blog is very useful for me, am very happy to read this blog Kindly visit us @ Luxury Watch Box | Shoe Box Manufacturer |  Candle Packaging Boxes

    ReplyDelete
  54. Accord IT Training is providing Best Dot Net coaching Institute in Chennai with placement.
    for any queries
    contact on +91 9940289059
    #Best Dot Net Training in Chennai
    #Dot Net Training in Chennai
    # Dot Net Course in Chennai

    ReplyDelete
  55. Hello! Someone in my Facebook group shared this website with us, so I came to give it a look. I’m enjoying the information. I’m bookmarking and will be tweeting this to my followers! Wonderful blog and amazing design and style.
    nebosh course in chennai
    offshore safety course in chennai

    ReplyDelete
  56. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.Devops Training in Chennai | Devops Training Institute in Chennai

    ReplyDelete
  57. Thanks for sharing this valuable information. Check on the below link if you are looking for best software training in chennai.
    AWS Training In Chennai
    Hadoop Training In Chennai
    Python Training In Chennai
    Selenium Training In Chennai
    Java Training In Chennai

    ReplyDelete
  58. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal.
    nebosh course in chennai
    offshore safety course in chennai

    ReplyDelete
  59. Thanks for sharing this valuable information to our vision. You have posted a worthy blog keep sharing.

    Article submission sites
    Education

    ReplyDelete

Featured Post

Advanced Selenium Webdriver Interview Questions and Answers in Java

Advanced Selenium Webdriver Interview Questions and Answers in Java Selenium WebDriver - QA Here is the list of Selenium Inte...