Home > Amit Bharamasali (Page 2)

Running selenium script parallel in multiple browsers using TestNg

We can run selenium scripts parallely in multiple browsers using TestNg.xml configuration. Below is the configuration we need to make in TestNg.xml to run in chrome and firefox browsers. Below is the sample code. It opens mundrisoft.com website in chrome

This Article is TAGGED in , , . Read more

JavaScriptExecutor in Selenium

Javascript executor is used to execute javascript from selenium. Actions which need to be performed forcibly can be performed using javascript executor. For example selenium not able to click on particular web element due to disable state of it but our requirement is to click on that element. In this

This Article is TAGGED in , , , . Read more

Take screenshot or print screen using selenium

For analysis , debugging and reporting it is important to take screenshot in any state of script execution. To achieve this in selenium we need to follow below steps Include library import org.openqa.selenium.TakesScreenshot; create object and call getScreenshotAs method And paste the file into proper location using FileUtils method copyFile. Type cast the TakesScreenshot

This Article is TAGGED in . Read more

API Automation Using Katalon Studio

Follow below steps to cofigure API Automation project. 1.Open Katalon studio by running exe file. 2.By Default it will create folders as shown below. 3.Right click on Object Repository > New > Web Service Request 4.Enter Name, Request Type and URL and click on OK 5.Test the API by clicking on Test Request 6.After successful response

This Article is TAGGED in , . Read more

Code to scroll in web page using selenium

Scroll can be done in two ways one is horizontal and another is vertical. In selenium scroll operation is done using JavaScriptExecutor. Code to scroll vertically Down by 500 pixel: [crayon-674e821657ff8461707585/] Code to scroll vertically UP by 500 pixel: [crayon-674e821657ffa364686989/] Code to scroll horizontally RIGHT by 500 pixel: [crayon-674e821657ffc176038747/] Code to scroll horizontally LEFT by 500

This Article is TAGGED in . Read more

Difference between find element and find elements in Selenium

Difference between find element and find elements. findElement() findElements() findElement() method used to access single web element findElements() method used to access multiple web elements. findElement() method returns first matching web element findElements() method returns list of all matching web elements If there is no matching web element then findElement() method throws exception If there is

This Article is TAGGED in , . Read more

Code to perform Image comparison in protractor

To perform image comparison in GUI Testing we need to install protractor-image-comparison module it can be installed using below command. Open command prompt and run below command. [crayon-674e8216582eb828526973/] Add below code in onPrepare function of configuration file [crayon-674e8216582ef062463835/] Code to do image comparison [crayon-674e8216582f2417299600/] ImageName is image file name exist in baseline folder. If image is not

This Article is TAGGED in , . Read more

Simple protractor script

Code for sample protractor script: In protractor there are two basic files to execute any automation script. Those are configuration file and specification file. Configuration file contains all configuration related code. And specification file contains test scripts. Configuration file is one for the project and we can have any number

This Article is TAGGED in . Read more

How to install protractor and configure?

To configure protractor below are the steps: 1. Download eclipse from https://www.eclipse.org/downloads/ and install it. 2. Download node.js from https://nodejs.org/en/download/ and install it. 3. Open the command prompt and run below command. It will install protractor globally. “npm install -g protractor”. 4. Run below command in protractor to update webdriver. “webdriver-manager update“. 5. Start the selenium server by running

This Article is TAGGED in . Read more