Monday, April 13, 2020

Interview Questions

How to extract date values in a string
-          How to use Listeners in framework. Ex: in order to insert test results in DB during runtime, what is the best way to do so
-          Tell me about collections
-          What are diff ways of passing parameters in feature file
-          Have you used TestNG, and why do we use it
-          There are date and timestamp(AM and PM format) values in a data table, how do you sort table rows while reading the cells
-          What are the challenges you have faced in project for selenium programming
-          What are mostly used OOPS concepts In your project

Apple interview:
1. Hashmap vs Hashtable
2. How to access or store data from excel employee records to java collections
3. Reflection in java
4. Different status codes  --- 401 unatuth, 403 -- forbidden, 415 - media format not supported
5. Runtime Exceptions vs compile time exceptions   -- file not found is what exception?
6. why main is public, static   -- So that jvm can access it. 
6.1 why main has String args[] parameters --- because when you create jar java application, you could pass parameters when running the jar file ex: java -jar myapplication.jar "a" "b". When you print args[0] and args[1] in main method, you will get a and b respecitively when main method is executed.
7. jar vs war. How to create Jar file, and what it contains. How to say where is main method if you have multiple class files when you create jar files. ...
jar --- is zip of java classes and resources. Java archive. Command used to create (go to the directory where you have java files): > jar -cf name.jar *.java 
7.1 How to use jar file
8. importance of maven  -- command like mvn clean verify
9. Desired capabilities
10. Browser profiling
11.Errors vs Exception  -- Errors caused by other than application-- like outofmemory, stackoverflow etc. Exception is due to application
12. Using Testng we add respective class which we wanted to test. But when we have new classes that are getting added instead of keep adding classes to testng is there a way to run entire suite
13.  mvn clean install vs mvn clean verify
14. What does final mean for a method   --- methods will final keyword cannot be overriden by subclasses
A class with final keyword means it cannot be extended.

role of JavaScript in selenium web automation testing

We use JavaScript to at two places as of now in web automation testing with selenium:

Interface JavaScriptExecutor in java will help to use execute javascript code in selenium

Scenarios where we use JavaScript:

1. To enter value in input field without using .sendkeys  method

2. To use arguments[0].ScrollToView   -- which scrolls to the element on the webpage

public void ScrollclickJS(WebElement we) {
              JavascriptExecutor executor = (JavascriptExecutor) driver.getWebDriver();
              executor.executeScript("arguments[0].scrollIntoView();"we);
              executor.executeScript("arguments[0].click();"we);
       }

Tuesday, October 22, 2019

Testng test report

1. Testng execute the class which has @test annotation before the method
2. Testng test results report will be created as soon as you run any class with annotation @test in it
3. Since we have @test annotation, we need not have main method
4. Once java class is written with @test annotation method run it with by right clicking class file -> select run as testng test. It will run the method and test ng report will be generated based on number of @test methods
5. You could run test suites by creating test ng XML file.
6. Test XML file created manually by selecting java project-> create file-> xml-> name.xml.
7. Once name.xml is created 
5. 

Tuesday, February 5, 2019

Need expertise on

- Eclipse set up and java program exec
- Reading&Undeestanding Eclipse errors and fixing
- Know all about Maven, bitbucket and Pom XML
-

Monday, September 17, 2018

Handle app authenticatication pop up

Scenario:
Authentication pop up comes when ever app URL is hit or navigated through diff pages. Where user has to provide his valid user ID and pwd to proceed . How to handle the pop up as it is window pop up.

Monday, January 8, 2018

Inbuilt Interface for taking Screenshots

Selenium jars have inbuilt interface that could help us take screenshots with less effort.