Selenium Articles - Page 8 of 37

How do I resolve the ElementNotInteractableException in Selenium WebDriver?

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:18:35

4K+ Views

We get the ElementNotInteractableException in Selenium if an element is available in DOM but not in a condition to be interacted. Some of the reasons for this exception are −There may be a covering of another element on the element with which we want to interact with. This overspread of an element over the other can be temporary or permanent. To resolve a temporary overspread, we can wait for an expected condition for the element.We can wait for the expected condition of invisibilityOfElementLocated for the overlay element. Or, wait for the expected condition of elementToBeClickable for the element with which ... Read More

Unable to locate an element using xpath error in selenium-java

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:18:08

9K+ Views

We may encounter the error - unable to locate element while working with Selenium webdriver. This leads to NoSuchElementException. This type of exception is thrown when there is no element on the page which matches with the locator value.If error is encountered, we can fix it by the following ways −Check if there is any syntax error in our xpath expression.Add additional expected wait conditions for the element.Use an alternative xpath expression.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class XpathError{    public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver", ... Read More

How to create a Javascript executor for making an element visible in Selenium Webdriver?

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:13:35

2K+ Views

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 More

Differences Between Selenium and Cucumber

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:13:10

832 Views

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 More

Mobile

What's the difference between RSpec and Cucumber in Selenium?

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:06:11

419 Views

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 More

How can I verify Error Message on a webpage using Selenium Webdriver?

Debomita Bhattacharjee
Updated on 07-Apr-2021 09:01:10

9K+ Views

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 More

What is Selenium Internet Explorer Driver or IE Driver?

Debomita Bhattacharjee
Updated on 07-Apr-2021 08:51:46

515 Views

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 More

C Sharp with Selenium - How to Switch one tab to another tab in Csharp Selenium?

Debomita Bhattacharjee
Updated on 07-Apr-2021 08:47:13

6K+ Views

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 More

How to set Page Load Timeout using C# using Selenium WebDriver?

Debomita Bhattacharjee
Updated on 07-Apr-2021 08:39:38

3K+ Views

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 More

Moving mouse pointer to a specific location or element using C# and Selenium

Debomita Bhattacharjee
Updated on 07-Apr-2021 08:38:51

7K+ Views

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 More

Previous 1 ... 6 7 8 9 10 ... 37 Next
Advertisements