Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Debomita Bhattacharjee
Page 17 of 59
How to create a Javascript executor for making an element visible in Selenium Webdriver?
We can create a JavaScript Executor for making an element visible in Selenium webdriver. A hidden element has a style attribute whose value set to display: none.For making an element visible on the page we have set the value of style attribute to block/ inline/ flex/ inline-block. Let us see the html code of an element which is visible(style= display: block) −Now on clicking the Hide button, the Hide/Show Example edit box becomes invisible on the page. Let us now see the html code of the Hide/Show Example edit box in hidden state(style= display: none) −JavaScript Executor can make the ...
Read MoreDifferences Between Selenium and Cucumber
There are differences between Selenium and Cucumber are listed below −Sr. No.SeleniumCucumber1It is a test automation framework.It is not a test automation framework.2Primarily used for automation testing of front end applications.Primarily used as a tool for behavior driven development.3Can be written in any programming language like Java, Python, Ruby, C#, and so on.Can be written in Gherkin language.4Developed in Java.Developed in Ruby.5Can only be used by users having technical knowledge.Can be used by users without any technical knowledge.6Less readable compared to Cucumber.Easily readable.7Installation is lengthy and complex compared to Cucumber.Installation is easy.8Conditional statements can be incorporated.Conditional statements cannot be incorporated.9Syntax ...
Read MoreWhat's the difference between RSpec and Cucumber in Selenium?
The differences between RSpec and Cucumber are listed below −Sr. No.RSpecCucumber1A testing framework which gives the option to build and execute tests.A tool which is used to create test cases in plain English text.2Mainly used for integration and unit testing.Mainly used for user acceptance testing.3Utilized for Test Driven Development by developers and for Behavior Driven Development by testers.Utilized for Behavior Driven Development.4Narrates step from a business specification using the Describe, Context and It blocks.Narrates step from a business specification with the Given, When, Then, And, But, and so on keywords.5Code for implementation of a step is available within the Describe, ...
Read MoreHow can I verify Error Message on a webpage using Selenium Webdriver?
We can verify error messages on a webpage using Selenium webdriver using the Assertion. In case, the actual and expected values do not match, an Assertion Error is thrown.Let us try to verify the highlighted error message.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import java.util.concurrent.TimeUnit; import org.testng.Assert; public class VerifyErrorMsg{ public static void main(String[] args) { System.setProperty("webdriver.gecko.driver", "C:\Users\ghs6kor\Desktop\Java\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); //implicit wait driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); //URL launch driver.get("https://www.linkedin.com/"); ...
Read MoreWhat is Selenium Internet Explorer Driver or IE Driver?
Selenium Internet Explorer Driver is used to execute test cases in the Internet Explorer browser. It is a standalone server that establishes a link between our Selenium test and the Internet Explorer browser.We can download the Internet Explorer Driver file from the below link − https://www.selenium.dev/downloads/Select and click on the download link which is compatible with our local operating system. As the download is done successfully, a zip file gets created. We have to unzip it and save the executable file - IEDriverServer.exe in a location.Next, we shall set the path of the IEDriverServer.exe file using the System.setProperty method. We ...
Read MoreC Sharp with Selenium - How to Switch one tab to another tab in Csharp Selenium?
We can switch one tab to another tab with Selenium webdriver in C#.Sometimes on clicking a link or a button, we can have multiple tabs opened in the same browser.By default, the webdriver can access only the parent tab. To access the second tab, we have to switch the driver focus with the help of the SwitchTo().Window() method. The window handle id of the tab where we want to switch to is passed as a parameter..The method CurrentWindowHandle yields the window handle id of the tab which is in focus. The WindowHandles method returns all the window handle ids of ...
Read MoreHow to set Page Load Timeout using C# using Selenium WebDriver?
We can set page load timeout using Selenium webdriver in C# using the PageLoad method. It is used to set time to wait for loading of the page. An exception will be thrown if the page is not loaded within the timeout specified.Syntaxdriver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10);Here, 10 is the amount of time in seconds.Exampleusing NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using System; using OpenQA.Selenium; namespace NUnitTestProject2{ public class Tests{ String url = "https://www.tutorialspoint.com/index.htm"; IWebDriver driver; [SetUp] public void Setup(){ //creating object of FirefoxDriver ...
Read MoreMoving mouse pointer to a specific location or element using C# and Selenium
We can move mouse pointer to a specific location or element in Selenium webdriver(C#) using the Actions class. We have to first create an object of this class.Next to move an element we have to apply the MoveToElement method and pass the element locator as a parameter to this method. Finally, to actually perform this task the method Perform is to be used.After moving to an element, we can click on it with the Click method. To move to a specific location, we have to use the MoveByOffset method and then pass the offset numbers to be shifted along the ...
Read MoreWhat are the different ways of handling authentication popup window using Selenium?
We can handle authentication pop-up window using Selenium webdriver by incorporating the username and password within the application URL. The format of an URL along with credential should be − https://username:password@URLLet us launch a web page having the authentication pop-up generated at page load −The user Name and Password fields are having value as admin.If we ignore this pop-up on clicking the Cancel button, we shall be navigated to the below page.If proper credentials are entered and then the OK button is clicked, we shall be navigated to the below page.In the above example, to handle the authentication pop-up, using ...
Read MoreHow can I get Webdriver Session ID in Selenium?
We can get the webdriver session id with Selenium webdriver using the SessionId class. A session id is a distinctive number that is given to the webdriver by the server.This number is utilized by the webdriver to establish communication with the browser. The commands in our Selenium tests are directed to the browser with the help of this session id. The method getSessionId is used to obtain the webdriver session id.SyntaxSessionId s = ((RemoteWebDriver) driver).getSessionId();Exampleimport org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.SessionId; import org.openqa.selenium.remote.RemoteWebDriver; public class BrwSessionId{ public static void main(String[] args) { //set ...
Read More