Posts

Selenium Interview Questions and Answers

Listing down some of the links for Interview questions and answers for Selenium webdriver Please feel free to add more under the comments. 1. http://www.techbeamers.com/category/interview-questions/selenium-interview/ 2. https://www.linkedin.com/pulse/selenium-real-time-interview-questions-answers-technologies-13600- 3. https://intellipaat.com/interview-question/selenium-interview-questions/

Dockerfile Explained

Rule no 1 - The name of the file should be " Dockerfile " only. Dockerfile is used to build images. It's  is a text file that contains all the commands a user could call on the command line to create an image. Here the commands you can use in a  Dockerfile are explained with examples wherever possible . Hope it helps. The general format of a command is "INSTRUCTIONS arguments". Ex : RUN echo "Hello Docker !!" FROM FROM <image> The  FROM  instruction sets the  Base Image  for subsequent instructions. As such, a valid  Dockerfile  must have  FROM  as its first instruction. The image can be any valid image – it is especially easy to start by  pulling an image  from the  Public Repositories . Ex : FROM ubuntu MAINTAINER MAINTAINER <name> This allows you to set the  Author  field of the generated images. RUN Executes a command and save the result as a new layer....

Getting started with Docker

Installation docker on a ubuntu machine - use the following commands sudo apt-get install docker.io To verify the docker is installed and check its version: sudo docker version Create a simple docker container in interactive mode Here in the below command - it used base ubuntu image , if ubuntu is available on ur machine it will pull from der else pulls from docker public repo-called as docker hub sudo docker run -t -i —name “ur container name” ubuntu /bin/bash Now the new container is created by name given and the control is now the the newly created container. List the containers on the machine docker ps -a delete the container -  sudo docker rm “container name” list docker images available -  docker images get out from the container  exit

Practice sites for Selenium

I know most of the people who are new to Selenium are looking for sites to practice selenium which have all kinds of scenarios such as hovering, multi-level hovering, drag and drop , resizable text fields multi select drop downs, frames, multiple windows and so on. My suggestion is to automate anything that you would see or do day in day out to practice or to help you in your regular repeated work ;) For example, automate your timesheets (great time saver , isn't it + its pretty boring ;) ,no offence though). But,i thought i would share what i have found so far. Below are some of them, please feel free to suggest more in the comments. 1. http://www.seleniumframework.com/demo-sites/ 2. http://store.demoqa.com 3. http://demoqa.com 4. http://toolsqa.com/automation-practice-form/ 5. http://toolsqa.com/automation-practice-switch-windows/ 6. http://toolsqa.com/automation-practice-table/ 7. http://toolsqa.com/handling-alerts-using-selenium-web...

Test Automation - Myths and Reality

TEST AUTOMATION IS SIMPLE, THAT EVERY TESTER CAN DO IT  This myth is promoted by the tool sales people. They are trying to promote the following test automation process:   - Record the script   - Enhance the script by adding functions and data driving  - Run the scripts  - Report results   Under the influence of this myth the QA manager can proudly report: All our testers are developing test automation. REALITY - TEST AUTOMATION IS A SOFTWARE DEVELOPMENT TASK   Automation should be designed, developed and tested  You need to have some kind of a programming background to implement test automation. Test Automation is not as complex as C++/C#/Java development.  Test automation standards should be developed  Automated test components are assets that should be treated like application source code

Highlighting WebElement in Selenium

We can highlight the WebElements under action during the execution to help capture them while failure analysis. It can be done using the below code. Have the utility function in for framework ,use it for all the actions performed at the framework level. See the sample below. Function to highlight the WebElement under execution: public static void elementHighlight(WebElement element ) { JavascriptExecutor js = (JavascriptExecutor) driver ; js .executeScript( "arguments[0].setAttribute('style',arguments[1]); , element , "color: red; border: 3px solid red;" ); } Use it as below, used in the plain function here, you need to embed it in your framework as to highlight all the elements under action. public static void main(String[] args ) throws InterruptedException {         System.setProperty( "webdriver.gecko.driver" , "Path to geckodriver" ); driver = new FirefoxDriver(); driver .get( ...

Handling SSL Certificates Errors with Selenium WebDriver

Image
Below are some of the sample SSL Certificate errors Firefox 2. IE 3. Chrome How do we bypass these pages through selenium webdriver. Its handled using the DesiredCapabilities class and setting up the Capability for handling SSL Error as below. DesiredCapabilities capability = DesiredCapabilities.chrome();  // To Accept SSL certificate  capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS,  true ); Then later pass the ‘capability’ object to the driver constructors as below. Firefox : FirefoxDriver driver =new FirefoxDriver(capability); 2. Chrome : System.setProperty( “webdriver.chrome.driver” ,  “E:/chromedriver.exe” ); ChromeDriver driver =  new  ChromeDriver(capability); 3. IE : System.setProperty( “webdriver.ie.driver” ,  “E:/IEDriverServer.exe” ); InternetExplorerDriver driver =  new  InternetExplorerDriver(capability);