- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 455 Articles for Software Testing
513 Views
We can get the complete screenshot of a page in Selenium. While executing any test cases, we might encounter failures. To keep track of the failures we capture a screenshot of the web page where the error exists.In a test case, there may be failure for reasons listed below −If the assertion does not pass.If there are sync issues between our application and Selenium.If there are timeout issues.If an alert appears in between.If the element cannot be identified with the locators.If the actual and final results are not matching.For capturing the screenshot, save_screenshot() method is available. This method takes the ... Read More
2K+ Views
We can extract values from a specific cell (say 2nd row and 3rd column) inside a table in Selenium. First of all we need to locate the cell with the help of xpath locator.Since the row and column numbers are given, we can create a customized xpath with the help of indexes specified for both and tags. The rows of a table are represented by tag in html code. The data in each row is enclosed with the tag in html. Thus a tag’s parent is always a tag.So to get the value at ... Read More
1K+ Views
We can count the number of occurrences of a particular text inside a table in Selenium. First of all we need to locate the element by xpath. In xpath, we have a particular text() function that identifies elements based on the visible text on the screen.Then we have to use find_elements method to get the list of matching elements having the text we are looking for on the page. Finally we need to get the size of that list with the help of the len function of the list.This will give the number of occurrences of a particular text inside ... Read More
9K+ Views
We can get all the values inside a table in Selenium with the help of find_elements method. The rows of a table are represented by tag in html code. To get all the rows, we shall use the locator xpath and then use find_elements_by_xpath method. The list of rows will be returned. Next we need to compute the size of the list with the help of len method.Syntaxdriver.find_elements_by_xpath("//table/tbody/tr")Once we get all the rows, we now have to compute the number of columns.The headers of a table are represented by tag in html and always in the first row ... Read More
293 Views
There are numerous assertions available to test relational comparisons in Selenium. They are listed below −assertGreater – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is greater than the second one, the test case is considered a pass; else the test case is failed.The third parameter of assertGreater is an optional one. It is mostly used for informational purposes for result analysis.SyntaxassertGreater(3, 2)assertGreaterEqual – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is greater than equal ... Read More
7K+ Views
There are assertions in Selenium which are verification or checkpoints for the test case. In the absence of an assertion, there is no option of determining if a test case has failed or not.Sometimes, we may use the conditional statements like if – else and so on and then print the result of pass/ fail in the console. But that can only solve the problem of checking logs and not for actual reporting.Thus assertion is used for generating test execution reports. In case, our test case passes all the test steps, the assertions do not impact the test cases in ... Read More
4K+ Views
We can perform the action of pressing ctrl+c keys in Selenium. There are multiple special Keys available that enable the act of pressing keys via a keyboard like ctrl+c, ctrl+v, ctrl+f and many more. These special Keys are a part of selenium.webdriver.common.keys.Keys class.key_down() – This method performs the action sending a key press only and not releasing it. The key_down() method is a part of Action Chains class. This method is widely used for coping and pasting actions via (ctrl+c, ctrl+v).In order to carry out this action, we need to first press the ctrl key downwards and simultaneously press C ... Read More
2K+ Views
We can perform the action of pressing ctrl+f keys in Selenium. There are multiple special Keys available that enable the act of pressing keys via a keyboard like ctrl+c, ctrl+v, ctrl+f and many more. These special Keys are a part of selenium.webdriver.common.keys.Keys class.key_up() – This method releases a modifier key. The key_up() method is a part of Action Chains class and used to release a key pressed via key_down(). This method is widely used for coping and pasting actions via (ctrl+c, ctrl+v).In order to carry out this action, we need to first press the ctrl key downwards and simultaneously press ... Read More
1K+ Views
We can click() method in Action Chain class in Selenium. These classes are generally used for automating interactions like context menu click, mouse button actions, key press and mouse movements.These types of actions are mainly common in complex scenarios like drag and drop and hovering over an element on the page. The methods of the Action Chains class are utilized by advanced scripts. We can manipulate DOM with the help of Action Chains in Selenium.The action chain object implements the ActionChains in the form of a queue and then executes the perform() method. On calling the method perform(), all the ... Read More
789 Views
We can perform mouse release from an element in Selenium with the help of Action Chains class. These classes are generally used for automating interactions like context menu click, mouse button actions, key press and mouse movements.These types of actions are mainly common in complex scenarios like drag and drop and hovering over an element on the page. The methods of the Action Chains class are utilized by advanced scripts. We can manipulate DOM with the help of Action Chains in Selenium.The action chain object implements the ActionChains in the form of a queue and then executes the perform() method. ... Read More