Found 719 Articles for Testing Tools

How to get text found between span – Selenium

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:33:55

3K+ Views

We can get the text found within the span tag with Selenium webdriver.The text of a web element can be captured with the method getText. Let us see an example of an element having the text - © Copyright 2021. All Rights Reserved enclosed within the span tag.SyntaxWebElement l = driver.findElement(By.xpath("//p/span")); String s = l.getText();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; public class SpanText{    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);       ... Read More

How to specify "ENTER" button functionality in Selenium WebDriver code?

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:26:42

3K+ Views

To specify ENTER button functionality in Selenium webdriver we have to use the method sendKeys. To simulate pressing the ENTER button, we have to add the statement import org.openqa.selenium.Keys to our code.Then pass the parameter – Keys.RETURN or Keys.ENTER to the sendKeys method.Let us make an attempt to press the ENTER button after entering some text in the Google search input box −ExampleCode Implementation with Keys.ENTERimport 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.openqa.selenium.Keys; public class EnterOperation{    public static void main(String[] args) {       System.setProperty("webdriver.gecko.driver", "C:\Users\ghs6kor\Desktop\Java\geckodriver.exe");       WebDriver driver = new FirefoxDriver(); ... Read More

How to print text from a list of all web elements with same class name in Selenium?

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:20:38

5K+ Views

We can get the text from a list of all web elements with the same class name in Selenium webdriver. We can use any of the locators like the class name with method By.className, xpath with method By.xpath, or css with method By.cssSelector.Let us verify a xpath expression //h2[@class='store-name'] which represents multiple elements that have the same class name as store-name. If we validate this in Console with the expression - $x("//h2[@class='store-name']"), it yields all the matching elements as shown below:Also, since we need to obtain multiple elements, we have to use the findElements method which returns a list. We ... Read More

Gecko driver, Selecting value from a dropdown list using Selenium

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:19:27

381 Views

We can use the Selenium webdriver scripts in Firefox (versions>47) with the help of the geckodriver.exe executable file. First, we have to download this file from the following link −https://github.com/mozilla/geckodriver/releasesOnce we navigate to the mentioned URL, we have to click a link based on the operating system (Windows, Linux or Mac) we are presently using. As the download gets over, a zip file is created. We have to extract the zip file and store the geckodriver.exe file in a desired location.Then, we have to configure the path of the geckodriver.exe file using the System.setProperty method along with creating an object ... Read More

How to resolve exception Element Not Interactable Exception in Selenium?

Debomita Bhattacharjee
Updated on 22-Oct-2023 13:04:10

23K+ Views

We can resolve the exception – ElementNotInteractableException with Selenium webdriver. This exception is thrown if a webelement exists in DOM but cannot be accessed. The below image shows an example of such an exception.If a specific webelement is overspread by another webelement we normally get this exception. To fix this, we can either apply explicit wait so that the webdriver waits for the expected condition - invisibilityOfElementLocated of the overlaying webelement.Or, we can apply the expected condition - elementToBeClickable on the webelement that we want to interact with. To resolve a permanent overlay, we have to use the JavaScript Executor ... Read More

How can I select date from a datepicker div using Selenium Webdriver?

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:14:00

2K+ Views

We can select data from a datepicker using Selenium webdriver. A datepicker in a calendar can be designed in numerous ways on the web UI. Based on the UI, we have to design our test.A calendar may have a dropdown for selection of day, month or year. It may also contain forward and backward navigation to move up and down in the dates or any other design. The below example shows a calendar having a datepicker. Let us make an attempt to select the date 03/02/2021(2nd March, 2021) date from the below calendar −In the above html code, we can ... Read More

How to use JavaScript in Selenium to click an Element?

Debomita Bhattacharjee
Updated on 03-Apr-2021 10:13:08

11K+ Views

We can use the JavaScript Executor in Selenium to click an element.Selenium can execute JavaScript commands with the help of the method executeScript.Sometimes while clicking a link, we get the IllegalStateException, to avoid this exception, the JavaScript executor is used instead of the method click. The parameters to be passed to the executeScript method to click an element are - arguments[0].click(); and the web element locator.SyntaxWebElement m=driver.findElement(By.linkText("Company")); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("arguments[0].click();", m);Let us click the link Company on the below page −Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; public class ClickLnkJS{    public ... Read More

What is Scalability Testing?

Vineet Nanda
Updated on 18-Mar-2021 11:06:06

281 Views

What is Scalability Testing and Learn with ExampleA system/application must have the capability to function flawlessly under excessive load. Scalability testing features the process where the efficiency of a system is tested based on a growing number of user requests, data volume, transactions, and user traffic. The developers identify the points where the system stops responding to changes and dig deeper to find its reasons.Salient features of Scalability TestingIt tells you how the application behaves under heavy loadIt let you know the limitation of the app in terms of user experienceIt helps you determine the efficiency and limits of the ... Read More

What is Volume Testing?

Vineet Nanda
Updated on 18-Mar-2021 10:59:00

195 Views

Volume Testing, aka Flood Testing, is a non-functional test used to see the software or application's performance when introduced to a high volume of data. The volume here refers to the size of the database or the file subjected to the test.Under the volume testing, the developers will keep adding data until the database reaches its threshold. Then the system will be analyzed for its response.For example, you want to add 1000 new products under the "TV" category on your eCommerce site. Before adding those entries into the database, you must ensure whether your site can handle such an extensive ... Read More

Agile Software Process and its Principles?

Vineet Nanda
Updated on 18-Mar-2021 10:53:43

5K+ Views

IntroductionIn case of software engineering, the software development takes a major chunk of the whole process. While Software development itself means dividing the whole development into multiple phases such as designing, product management, project management etc., organizations across the world follow various software development methodologies for successful project management.Various methodologies such as Agile methodologies, Waterfall model, DevOps deployment, Rapid application development etc. used by different organizations and all of them have their own share of pros and cons. However it’s the Agile software development methodology, which is widely used across the globe due to its iterative development approach.What is Agile ... Read More

Advertisements