ans
ans
Automation testing automates the manual testing process which facilitates the creation of multiple testing
scripts that can be executed repeatedly without any manual intervention.
Q2). Are there any benefits of automation testing over manual testing?
The advantages of automation testing are just the endless. Here we have discussed on some of the major
benefits that are usually experienced by testing professionals during the entire process –
Q3). Selenium is a single testing tool, then why it is taken as a suite by professionals?
The tools available to work with selenium are specially designed to cater to different testing requirements
so it is taken as a testing package not only a single tool.
Q10). Can you name the popular selenium tool used by large industries worldwide?
Selenium Web Driver is a popular testing tool used by big Companies today.
Q11). Explain about the waiting methods in selenium Web Driver?
The two popular waiting methods in selenium Web Driver are – implicit wait an explicit wait. Implicit
waiting method is used when Web Driver is not able to find elements in the document, then it waits for the
certain time period for the element to appear in the document.
At the same time, the explicit waiting method is an advanced technique that allows developers to write
custom codes whenever required.
Q12). Where the implicit waiting method and explicit it waiting method can be used in
your script?
Implicit waiting method is time-consuming but suitable for all types of elements, but the explicit wait time
is used for selected elements only.
Q13). Is there any technique to check either button is enabled on the page or not?
For this purpose, you need to use the Enabled() method in your script. The return value of the method
would be a Boolean. If the return value is true, then the button will be enabled otherwise it will not.
Q14). Is there any technique to check either particular element is visible on the page or
not?
For this purpose, you need to use the is Displayed() method in your script. The return value from the
method would be Boolean. If the return value is true then the element will be visualized otherwise it will
not.
Q16). Name the different type of mobile testing drivers supported in WebDriver?
These are iPhone, Android, and Opera Mobile Drivers etc.
Q17). Name the programming languages that are used by Web Driver to write the test
cases?
These are PHP, Python, Ruby, C#, PERL, Java etc.
Q18). Do you know the difference between assert commands and verifying commands in
Selenium WebDriver?
Assert command and verify commands both will check the conditions for Booleans values. In case the
condition is false then assert command will halt the program but verify command does not halt the
program but it takes it to the next phase of execution.
Q19). Explain the difference between"/" and "//"in XPathSelenium Web Driver?
As we have discussed already based on XML path of web elements, XPath is used to locate elements on
web page. Like UNIX, Linux, or any other programming language, single slash ("/") represents absolute
path while double slash ("//") in XPath represents an arelative path.
Q22). How will you check result of text execution in Selenium IDE?
The result for text execution in selenium IDE is displayed in Log Window.
Q26). How will you explain the difference between quit () and close () methods in
Selenium?
Quit() method ends all the browsers running in Web Driver while close() method ends the current browser
only.
Q27). Why was the concept of waiting method introduced in Selenium? Name the type
of waits in Selenium?
The waiting methods were specially introduced for AJAX based apps in Selenium WebDriver. The two
popular types of waits in Selenium are names as Implicit waits and Explicit waits.
Here, one is passing the username and password via the URL.
The syntax is: http://username:password@URL
For example,
Username: rohit
Password: P@ssword
URL: www.myurl.com
– Using AutoIT
WinWaitActivate(“Authentication Required”,””)
Send(“rohit{TAB}P@ssword{ENTER}”)
– With Alerts
One can handle auth pop-ups with alerts with,
driver.switchTo().alert();
driver.findElement(By.id(“userID”)).sendKeys(“userName”);
driver.findElement(By.id(“password”)).sendKeys(“myPassword”);
driver.switchTo().alert().accept();
driver.switchTo().defaultContent();
In case passing by URL does not work, one can also obtain credentials by Chrome
extensions and driver.
2. The Selenium script runs in Chrome but not
in IE. What can be done?
HTML DOM rendering and CSSOM construction differs from one browser to the next. So,
there may be multiple reasons for a script not working on IE. One can attempt to
troubleshoot the problem by:
DesiredCapabilities are commonly used with Selenium Grid, for parallel execution of test
cases on different browsers. However, one can use both DesiredCapabilities and
ChromeOptions using merge:
For visual validations, one can do RWD testing with Ocular library. Similarly, WAVE
Evaluator can be used for check compliance with accessibility standards automatically.
Yes, it’s possible to do database testing with Selenium. First you need to make a
connection between the server and the database. To do so you need a JDBC connection.
JDBC is an SQL-based Java API that allows for connectivity between the Java
programming language and various databases. With JDBC it is possible to connect with
the database and execute queries. Once these two steps are done, one can process the
results. Key components of JDBC are:
1. Driver manager
2. Driver
3. Connection
Class.forName(“com.mysql.jdbc.Driver”);
To send queries to the database one can use the Statement object. Similarly, to process
the data one can use a getXXX() method.
1. Soft assert
This type of assertion will just verify the condition and give the result, but it won’t abort
the test case execution when the test case fails.
2. Hard Assert
This type of assertion checks for the expected result, and if the condition fails to match,
it will abort execution and throw the “java.lang.AssertionError” exception.
assertEquals()
assertNotEquals()
assertNull()
assertNotNull()
assertTrue()
assertFalse()
@DataProvider(name= “searchProvider”)
The return type of the @dataProvider annotation is a 2D array. So, if the array is 3*4
objects, there will be 3 test cases, each having 4 parameters.