Selenium Webdriver Questions to Succeed in a Job Interview.Core Concept Related Selenium Webdriver Questions.Q How many types of Webdriver APIs are available in Selenium Ans.Below is the list of driver classes that you can use for the browser automation.Android. Driver,Chrome.Driver,Event. Firing.Web. Driver,Firefox.Driver,Html. Unit.Driver,Internet. Explorer.Driver,IPhone. Driver,IPhone.Simulator. Driver,Remote.Web. Driver. Q How would you make sure that a page is loaded using Selenium and Webdriver Ans.In Selenium, you can use the below lines of code to check for the successful loading of a web page.The best approach is by selecting an element from the page stand by till it becomes clickable.For. Page. To. Load5.Element. Presentany page element true.Speed5. Thread. Below is the Webdriver specific code to achieve the same objective.Web. Driver. Wait check new Web.Driver. Waitdriver, 1.Expected. Conditions.Database-Testing-Interview-Questions-and-Answers.jpg' alt='Face To Face Interview Questions On Manual Testing' title='Face To Face Interview Questions On Manual Testing' />ElementBy.Q How to launch a batch file in a Selenium Webdriver project Ans.Its usual in a test suite to run a batch file or an executable file for setting up the pre requisites before starting the automation.You can use the below Java code for this purpose.Process batch Runtime.Runtime. execpath of the batch file.For Q How do you read a Java.Script variable in Selenium Web.Driver Ans. Its easy to access any Java.Script variable from the Selenium Webdriver test scripts.Just you need to use the below Java code snippet.Initialize the JS object.Javascript. Executor JS Javascript.Executor webdriver.In this post I am going to answer some of the questions asked by one of the reader Srinivas M.In an application currently in production, one module of code is.Lets face it, theres no shortage in potential questions at any given interview across a wide variety of topics in information security.On top of that, InfoSec.Get the current site title.String sitetitle StringJS.Scriptreturn document.System. out. printlnMy Site Title sitetitle Q How to run the selenium IDE test suite from the command lineAns.Weve given the command to run the SIDE test suite in the next line.Java jar C Selenium Webdriver Questionsselenium server standalone 2.Suite firefox http www.C Selenium Webdriver QuestionsSelenium.Suite. HTMLQ How to run the Selenium Webdriver test from the command line Ans.We can run any Selenium Webdriver test written in Java using the following command.Sample. Class. Q What are the different exceptions you face in Selenium Webdriver Ans.Web. Driver. Exception,No.Alert. Present. Exception,No.Such. Window. Exception,No.Such. Element. Exception,Timeout.Exception. Q How would you automatically click a screenshot whenever any exception occursAns.For this you will have to use lt Event. Amazing New Software Free Download more. Firing. Web. Driver class and needs to implement the lt on.Exception method of the lt Web.Driver. Event. Listener interface.See the code example given below.Web. Driver browser new Firefox.Driver. Event. Firing.Web. Driver event.Driver new Event.Firing. Web. Driverbrowser.Abstract. Web. Driver.Event. Listener. ExceptionThrowable throwable, Web.Driver browser. Take the screenshot using the Webdriver.File screen Takes.Screenshotdriver.Screenshot. AsOutput.Type. FILE. Now you can copy the screenshot somewhere on your system.File. Utils. copy.Filescreen, new Filec Selenium Testing Questionsscreen.Driver. find. ElementBy.Caught the Expected exception.Intentionally causing the exception for demo.No. Such. Element.Exception e. Triggering point for the lt on.Exception event. Q How would you select any particular text using the Selenium Webdriver Ans.It seems an easy one at first but you need to do a little more to achieve this.Web. Element item driver.ElementBy. xpathpcontainstext,Selenium webdriver quesions.Actions dummy new Actionsdriver.Clickitem. build.Q Give an example to perform drag and drop action In Selenium Web.Driver Ans. Yes, we can use the Advanced User Interactions API to perform drag and drop operations in a Selenium Webdriver project.Code example Actions act new Actionsdriver.And. Dropsourcelocator, targetlocator.Or you can use the below code style.Actionsdriver. And.Dropsourcelocator, targetlocator.Q How would you fill a text field without calling the send.Keys Ans. Its a bit slower than the send.Keys method but we do have means to type in a text field.See the Java code given below.Javascript. Executor JS Javascript.Executorwebdriver.JS. execute. Scriptdocument.Element. By. IdUser.JS. execute. Scriptdocument.Element. By. IdPass.Q How can you check the state of a checkboxradio buttonAns.We can call the is.Selected method to test the status of these elements.Example Code boolean test driver.ElementBy. xpathcheckboxradio button XPath.Selected Q How would you handle the alert popups in Selenium Webdriver Ans.First, youve to switch the control to the pop up then press the ok or cancel button.After that, turn back to the source page screen.Code Example String src.Page driver. get.Window. Handle. Alert pop driver.To. alert shift control to the alert popup.Move the control back to source page.To. windowsrc. Page move back to the source page.Q What is the process to start the IEChrome browser Ans.If you want to start a browser then, just set the system properties as mentioned below.For the IE web browser.System. set. Propertywebdriver.Web. Driver driver new Internet.Explorer. Driver.For the Chrome web browser.System. set. Propertywebdriver.Web. Driver driver new Chrome.Driver Q How would you simulate the right click operation in Web.Driver Ans. You can make use of the Actions class features.Actions test new Actionsdriver Here, driver is the object of Web.Driver class. test.To. Elementelement.Click. perform Q How would you select a menu item from a drop down menu Ans.There can be following two situations.If the menu has is using the lt select tag then you can call the lt select.By. Value or lt select.By. Index or lt select.By. Visible. Text methods of the Select class.If the menu doesnt use the lt select tag then simply find the XPath of that element and perform the click action for its selection.Q What is the Firefox.Driver, class or an interface And which interface does it implementAns.Firefox. Driver is a Java class, and it implements the lt Web.Driver interface.It contains the implementations of all the methods available in the lt Web.Driver interface.Q What is the name of the super interface of the Webdriver Ans.Search. Context. Q What is the main difference between the close and quit methods Ans.Q What is the best way to check for the highlighted text on a web pageAns.Use the below code to verify the highlighted text for an element on the web page.String clr driver.ElementBy. xpathatextTech.Beamers. get. Css.Valuecolor. String bkclr driver.ElementBy. xpathatextTech.Beamers. get. Css.Valuebackground color.System. out. printlnclr.System. out. printlnbkclr Q How would you use a Selenium variable say size from the Java.Script Ans. sizeQ What is the Selenese command to show the value of a variable in the log file Ans.CSSXPath Related Selenium Webdriver Questions.Q How would you differentiate between the absolute and relative XPath Ans.Single slash signifies an absolute XPath.Double Slash represents the relative XPath.Q What are the different ways to find the element by CSS class Ans.Say, the name of the CSS class is lt My.Test. Then, the most simple way to find the element is as follows.My. TestIf you want an exact comparison to avoid matching texts like Ohh.My. Test or My. Testing then use this.My. Test You can even use the lt normalize space function to remove any leading or trailing whitespaces.My. Test Q How to specify a child element using XPath Ans.Q How to specify a child element using CSS Ans.Q How to identify a sub child element using XPathAns.Q How to identify a sub child element using CSS Ans.Q How do you access an element ID using CSS Ans.Q How would you get to the next sibling Ans.You may try this code.Or you can use the below code.Test. NG Selenium Webdriver Questions.Q What is the time unit you use in testng time testsAutomated Testing Software Testing Interview Questions and Answers.Why Software Testing Automated Testing Interview QuestionsIn this section you can learn and practice interview questions based on Software Testing Automated Testing and improve your skills in order to face the interview, competitive examination and various entrance tests CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.Where can I get Software Testing Automated Testing interview questions and answers with explanation India.BIX provides you lots of fully solved Software Testing Automated Testing interview questions and answers with Explanation.All students, freshers can download Software Testing Automated Testing quiz questions with answers as PDF files and e.Books. Solved examples with detailed answer description, explanation are given and it would be easy to understand.View the solution for the problems with feel and good user interface easily go through all questions and answers.How to answer Software Testing Automated Testing interview questions You can easily answer the interview questions based on Software Testing Automated Testing by practicing the exercises given below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2018
Categories |