Found 871 Articles for Automation Testing

How to perform mouseover function in Selenium WebDriver using Java?

Debomita Bhattacharjee
Updated on 28-Aug-2020 06:20:57

710 Views

A mouse hover is done on an element to fire an event on that element. If we hover on the menus of a webpage the submenus appears. Thus this event gets triggered on hovering on an element.It is evident from the above image that on hovering over the Packages menu the color of the text changed along with the tooltip display. Selenium has the Actions class that contains multiple APIs for mouse cursor movement.The moveToElement() method is used to perform mouse movement. We have to import org.openqa.selenium.interactions.Actions for Action class. Along with moveToElement() we have to use the perform() method ... Read More

How do I find an element that contains specific text in Selenium Webdriver?

Debomita Bhattacharjee
Updated on 28-Aug-2020 06:18:35

1K+ Views

We can find an element with a specific text visible on the screen in Selenium. This is achieved with the xpath locator. The xpath locator contains some in-built functions that help to create customized xpath.Let us consider a portion of the web page as given below −text() − It is a built in function to identify an element based on the text displayed on the screen. For example, if we want to identify Library from the above webpage, the customized xpath with text() should be −Syntax//*[text()='Library']contains() − It is a built in function to identify an element based on the ... Read More

Scroll Element into View with Selenium.

Debomita Bhattacharjee
Updated on 31-Oct-2023 03:48:50

23K+ Views

We may need to perform action on an element which is not present in the viewable area of the page. We need to scroll down to the page in order to reach that element.Selenium cannot perform scrolling action directly. This can be achieved with the help of Javascript Executor and Actions class in Selenium. DOM can work on all elements on the web page with the help of Javascript.Selenium can execute commands in Javascript with the help of the execute_script() method. For the Javascript solution, we have to pass true value to the method scrollIntoView() to identify the object below ... Read More

How to take screenshot with Selenium WebDriver?

Debomita Bhattacharjee
Updated on 28-Aug-2020 06:09:49

3K+ Views

Whenever we encounter a failure during testing, it is a common nature to capture the screenshots wherever there is a deviation from the expected result. Thus it is considered a mandatory step to attach a screenshot for creating a bug.While automating a bunch of test cases of a considerable number, capturing screenshot is critical to infer why a test case has failed for both the development and testing team. As they debug the failures, going through the screenshot and conclude if the failure is due to script issue or defect in the application.Let us discuss which part of the page ... Read More

Can selenium handle Windows based pop up?

Debomita Bhattacharjee
Updated on 28-Aug-2020 06:04:55

4K+ Views

Selenium can handle Windows based pop up. There may be scenarios where a web page opens more than one window after performing some actions on it. The child windows that get opened may be a pop up containing some information or advertisement.Selenium uses the getWindowHandles () and getWindowHandle () methods to work with child windows. The getWindowHandles () method contains all the window handle ids of the opened windows. The window id handles are held in the form of Set data structure [containing data type as String].The getWindowHandle () method is used to store the window handle id of the ... Read More

Difference between selenium IDE, RC & WebDriver.

Debomita Bhattacharjee
Updated on 28-Aug-2020 06:01:09

4K+ Views

The differences between selenium IDE, RC & Webdriver are listed below :FunctionalitiesSelenium IDESelenium RCSelenium WebdriverRecord and playbackIt has the record and playback feature.It does not have a record and playback.It does not have a record and playback.ServerIt requires no server to start execution of test cases.It requires the server to start execution of test cases.It requires no server to start execution of test cases.BrowserIt can be used for testing only in Firefox.It can be used for testing in the majority of browsers.It can be used for testing in the majority of browsers including in headless mode.Object OrientedIt is based on ... Read More

How to group selected tests from a set of tests in pytest?

Debomita Bhattacharjee
Updated on 29-Jul-2020 12:47:19

228 Views

We can group selected tests for execution from a set of tests in pytest.Pytest is a test framework in python. To install pytest, we need to use the commandpip install pytest. After installation, we can verify if python has been installed by the command pytest –version. The version of pytest shall be known.Pytest can be used for creating and executing test cases. It can be used in wide range testing API, UI, database and so on. The test file of pytest has a naming convention that it starts with test_ or ends with _test keyword and every line of code ... Read More

How to run a selected test from a set of tests in pytest?

Raju Kumar
Updated on 29-Jul-2020 11:46:46

350 Views

We can run a selected test from a set of tests in pytest. Pytest is a test framework in python. To install pytest, we need to use the command pip install pytest. After installation, we can verify if python has been installed by the command pytest –version. The version of pytest shall be known.Pytest can be used for creating and executing test cases. It can be used in wide range testing API, UI, database and so on. The test file of pytest has a naming convention that it starts with test_ or ends with _test keyword and every line of ... Read More

How to use fixtures in pytest?

Debomita Bhattacharjee
Updated on 29-Jul-2020 11:22:29

325 Views

The fixtures are methods which shall execute before each test method to which it is associated in pytest. Pytest is a test framework in python. To install pytest, we need to use the command pip install pytest. After installation, we can verify if python has been installed by the command pytest –version. The version of pytest shall be known.Pytest can be used for creating and executing test cases. It can be used in wide range testing API, UI, database and so on. The test file of pytest has a naming convention that it starts with test_ or ends with _test ... Read More

How to run a test method without reporting as passed or failed in pytest?

Debomita Bhattacharjee
Updated on 29-Jul-2020 11:21:13

342 Views

We can run a test method without reporting as passed or failed in pytest. This test method is generally used as a prerequisite. Pytest is a test framework in python. To install pytest, we need to use the command pip install pytest. After installation, we can verify if python has been installed by the command pytest – version. The version of pytest shall be known.Pytest can be used for creating and executing test cases. It can be used in wide range testing API, UI, database and so on. The test file of pytest has a naming convention that it starts ... Read More

Advertisements