Moving ahead with our Selenium WebDriver tutorial, we would be creating WebDriver script. We would also scatter the light on the basic and commonly used WebDriver. A common problem we face during automation using selenium webdriver to handle the ajax calls. How to write selenium script without using Selenium IDE recording, so we initiated this post & explained how to start writing Selenium WebDriver script by your own.
SUDHAKAR'S TEST AUTOMATION BLOG: Automation Object Model.
Free QA Automation Tools Tutorials. Ques 1)What are the annotations used in Test.
NG ? Ans: @Test, @Before. Suite, @After. Suite, @Before. Test, @After. Test, @Before. Class, @After. Class, @Before. Method, @After. Method. Ques 2) How do you read data from excel ? It is very useful to identify the dynamic web elements.
Ques 4)What are different types of locators ? Ans- There are 8 types of locators and all are the static methods of the By class. By. id(), By. name(), By. Name(), By. class. Name(), By. link. Text(), By. partial. Link. Text(), By.
How to Selenium Webdriver download and configure with Eclipse & run your first Selenium WebDriver script. Before start working with the Learn Selenium Web Driver. Selenium supports only web-based applications and to open them we need a browser. Here is how to set up drivers for the different popular browsers. Selenium-WebDriver Wait commands covers ImplicitlyWait, FluentWait, ExpectedConditions, PageLoadTimeOut, SetScriptTimeOut and Sleep commands with examples. Hi I got a request for you.Can you please write a code to get test run results of a test set and save it into an excel sheet.?(use OTA)Let me know.
By. css. Selector(). Ques 5)What is the difference between Assert and Verify? Ans- Assert- it is used to verify the result. If the test case fail then it will stop the execution of the test case there itself and move the control to other test case. Verify- it is also used to verify the result. If the test case fail then it will not stop the execution of that test case. Ques 6)What is the alternate way to click on login button?
Ans- use submit() method but it can be used only when attribute type=submit. Ques 7)How do you verify if the checkbox/radio is checked or not ? Ans- We can use is. Selected() method. Syntax –. driver. Element(By. xpath(.
These are the methods of the Select class. If the menu has not been created by using the select tag then we can simply find the xpath of that element and click on that to select. Ques 1. 5)How do you simulate browser back and forward ?
It return only one Web. Element type. find. Elements()- it used to find more than one web element. It return List of Web. Elements. Ques 1. How do you achieve synchronization in Web. Driver ? Ans- We can use implicit wait.
Syntax- driver. manage(). Wait(1. 0,Time. Unit. SECONDS); Here it will wait for 1. This code will attach with each and every line of the script automatically.
It is not required to write every time. Just write it once after opening the browser. Ques 2. 0)Write the code for Reading and Writing to Excel through Selenium ?
There are also webdriver implementations for PHP and Perl. Ques 2. 4)How do you clear the contents of a textbox in selenium ? Ans- Use clear() method. That is, running multiple tests at the same time against different machines, different browsers and operating systems. Essentially, Selenium- Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.
Ques 3. 1)How to get the number of frames on a page ? The return type of the method is boolean. So if it return true then element is visible else not visible. The return type of the method is boolean. So if it return true then button is enabled else not enabled.
The return type of the method is boolean. So if it return true then button is selected else not enabled. Similarly, you can get the values of attributes such as title, alt etc.
Similarly you can get CSS properties of any tag by using get. Css. Value(“some propety name”). Ques 4. 2)How to check whether a text is underlined or not ? It implements all the methods of Web. Driver interface.
Ques 4. 9)Which is the super interface of webdriver ? Ans- Search. Context. Ques 5. 0)What is the difference b/w close() and quit()? Ans- close() – it will close the browser where the control is.