Found 161 Articles for Rest Assured

How to exclude a test from execution in Pytest?

Debomita Bhattacharjee
Updated on 19-Nov-2021 12:09:05

5K+ Views

We can exclude a test from execution 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 a wide range of 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 should ... Read More

How to execute a selected test from a collection of tests in Pytest?

Debomita Bhattacharjee
Updated on 19-Nov-2021 12:04:57

509 Views

We can execute a selected test from a collection 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 a wide range of 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 ... Read More

What is a Pytest framework?

Debomita Bhattacharjee
Updated on 19-Nov-2021 12:01:45

493 Views

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 a wide range of 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 should be inside a method that should have a name ... Read More

How to get the total number of radio buttons on a page using Selenium?

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:58:10

1K+ Views

We can get the total number of radio buttons on a page using Selenium webdriver using the find_elements method. While working on any radio buttons, we will always find an attribute type in the html code and its value should be radio.This characteristic is only applicable to radio buttons on that particular page and to no other types of UI elements like edit box, link, and so on.To retrieve all the elements with attribute type = 'radio', we will use find_elements_by_xpath() method. This method returns a list of web elements with the type of xpath specified in the method argument. ... Read More

How to get the total number of checkboxes in a page using Selenium?

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:55:54

2K+ Views

We can get the total number of checkboxes in a page using Selenium webdriver using find_elements method. While working on any checkboxes, we will always find an attribute type in the html code and its value should be checkbox.This characteristic is only applicable to checkboxes on that particular page and no other types of UI elements like edit box, link and so on.To retrieve all the elements with attribute type = 'checkbox', we will use find_elements_by_xpath() method. This method returns a list of web elements with the type of xpath specified in the method argument. In case there are no ... Read More

What are some of the rules of creating a CSS expression?

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:54:18

304 Views

There are some rules for creating a CSS expression. The CSS is one of the important locators in Selenium. A customized CSS can be developed with the help of attributes like id, class name, and by the combination of tagname and html attributes.The ways of creating a CSS are listed below −Using a class name html attribute.This will select the web element of that particular class represented by (.)classname.Syntax− driver. find_element_by_css_selector(".name")Here name is the value of the attribute class.Using an id html attribute.This will select the web element of that particular id represented by (#) id.Syntax− driver. find_element_by_css_selector("#search")Here search is ... Read More

How to use regular expressions in a CSS locator?

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:50:54

4K+ Views

We can use regular expressions in a CSS locator. We can identify elements by matching their attributes partially with the help of regular expressions. In CSS, there are multiple methods to achieve this. They are listed below −Using the wild character *. This means the string contains our given text.Syntax− driver.find_element_by_css_selector("input[name*='sel']")It will search the input tag which contains the 'name' attribute containing 'sel' text.Using the wild character ^. This means the string starts with our given text.Syntax− driver.find_element_by_css_selector("input[name^='Tut']")It will search the input tag which contains the 'name' attribute starting with 'Tut' text.Using the wild character $. This means the string ... Read More

How to trigger headless test execution in Selenium with Python?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:58:05

805 Views

Selenium supports headless execution. In the Chrome browser, the headless execution can be implemented with the help of the ChromeOptions class. We have to create an object of this class and apply the add_arguments method to it. Finally, pass the parameter --headless to this method.Let us obtain the title - About Careers at Tutorials Point - Tutorialspoint of the page launched in a headless mode −ExampleCode Implementationfrom selenium import webdriver from selenium.webdriver.chrome.options import Options #object of Options class c = Options() #passing headless parameter c.add_argument("--headless") #adding headless parameter to webdriver object driver = webdriver.Chrome(executable_path='../drivers/chromedriver', options=c) # implicit wait time driver.implicitly_wait(5) ... Read More

How to work with id locator in WebdriverIO?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:51:12

891 Views

We can work with the id locator in WebdriverIO. Once we navigate to a webpage, we have to interact with the web elements available on the page like clicking a link/button, entering text within an edit box, and so on to complete our automation test case.For this, our first job is to identify the element. We can use the id attribute for an element for its identification. It is a very useful locator and speeds up the execution of automation tests in comparison to all the locators.In the WebdriverIO code, we have the option to specify the value of the ... Read More

How to perform drag and drop actions in WebdriverIO?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:46:36

1K+ Views

WebdriverIO can perform mouse operations like drag and drop using the dragAndDrop method. With this, we execute clicking and holding events on the present object(source), then pass the object to the target element. Finally, release the mouse.Syntaxlet p = $('#loc') let t = $('#target') p.dragAndDrop(t)Here, p is the source locator and t is the destination locator.Let us perform the drag and drop functionality for the below elements −In the above image, the element with the name - Drag me to my target has to be dragged and dropped on the element - Dropped!.ExampleCode Implementation// test suite name describe('Tutorialspoint application', function(){ ... Read More

Advertisements