Create Sessions in Postman

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:41:59

606 Views

A session is a temporary fold that stores values of variables. They are used for the present instance and have a local scope. In Postman, we can modify the session variable value to share workspace among teams.Postman gives the feature of local session share. Even if a Collection can be shared among teams, the sessions are never shared. Different tokens have to be generated while a task is to be carried out in a team structure.A session has a local scope for a user within his Workspace and any modifications he makes shall not be reflected in the server. In ... Read More

Scenario Outline Keyword in Cucumber

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:39:59

593 Views

Scenario Outline is used to replicate the same Scenario with a different data set. Writing the same tests with different values is cumbersome and time taking. For instance, We can club the above two scenarios with the Scenario Outline.Thus, we see that a Scenario Outline should be accompanied by keyword Examples. A Scenario Outline is executed once for each of the rows appearing below the Examples segment.Also, we have seen that the Given step has the delimiter. It points to the header of the Examples table. SpecFlow shall put the values within this table before the task of matching ... Read More

Example Keyword in Cucumber

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:37:56

5K+ Views

We can perform data-driven testing with the help of keyword Examples. We shall also take the help of keyword Scenario Outline to execute the same Scenario over multiple values.The data sets to be taken into consideration shall be passed below the Examples section one after another separated by | symbol. So, if there are three rows, we shall have three test cases executed from a Single scenario.Also, the Given step has the delimiter. It points to the header of the Examples table. SpecFlow shall put the values within this table prior to the task of matching a step with ... Read More

Background Keyword in Cucumber

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:30:23

11K+ Views

The Background keyword is applied to replicate the same steps before all Scenarios within a Feature File.Background RulesLet us describe some of the rules while applying Background −It should be used for defining simple steps unless we are forced to bring the application to a state which requires complicated steps to be carried out. As requested by the stakeholders of the project.It should be brief and realistic.All the Scenarios should also be short and to the point.Background ExampleLet us see an example where we have used Background steps to be executed before all the tests in the Feature File. For ... Read More

What is Test Driven Development

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:21:11

369 Views

Test-Driven Development is also known as the TDD. It consists of the below steps to be followed one-by-one −Step 1− Create a Test.Step 2− Verify if the test fails.If the test passes, create the second test.If the test fails, then move to Step 3.Step 3− Fix the test to make it pass.If the test passes, move to Step 4.If the test fails, then jump to Step 3.Step 4− Start code refractor and redo all the above steps till the development is done.Benefits of TDDThe benefits of TDD are listed below −The developer is required to apprehend the requirements to know ... Read More

Explain a Step Definition in SpecFlow

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:19:32

2K+ Views

To execute the Feature file, we must add the implementation logic for each of the steps. To add the definition of the step in SpecFlow, the C# language is used. Thus, a Step Definition File contains methods developed in C# within a Class.The methods have annotations along with a pattern to connect the Step Definition to every matching step. SpecFlow shall run the code to execute the keywords in Gherkin.A Step Definition file is a link between the application interface and Feature File. For providing readability features, the Step Definition File can have parameters. This signifies that it is not ... Read More

Explain a Feature File in SpecFlow

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:15:37

3K+ Views

The SpecFlow test execution begins from the Feature File. Here all the Features and their corresponding Scenarios are explained in plain text. It has a dual role of serving as an automation element as well as for documentation. A Feature File consists of one or more Scenarios in form of a list.Feature File CreationOnce a SpecFlow project is created, go to the Solution Explorer, and expand it.Right-click on the Features folder. Click on Add, then select the option New Item.Add New Item pop-up comes up. Type SpecFlow Feature in the search box. Select the option SpecFlow Feature File from the ... Read More

Handle Frame in WebDriver

Debomita Bhattacharjee
Updated on 18-Nov-2021 11:51:05

359 Views

We can handle frames in Selenium webdriver. The frames in an html code are represented by the frames/iframe tag. Selenium can handle frames by switching the webdriver access from the main page to the frame.Methods to handle frames are listed below −driver.switch_to_frame("frame name") - frame name is the name of the frame.driver.switch_to_frame("framename.0.frame1") - used to access the subframe in a frame by separating the path with a dot. Here, it would point to the frame with the name frame1 which is the first sub-frame of the frame named framename.driver.switch_to_default_content() - used to switch the webdriver access from a frame to ... Read More

Handle Authentication Popup in Selenium WebDriver Using Java

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

1K+ Views

We can handle authentication popup in Selenium webdriver using Java. To do this, we have to pass the user credentials within the URL. We shall have to add the username and password to the URL.Syntax −https://username:password@URL https://admin:admin@the-internet.herokuapp.com/basic_auth Here, the admin is the username and password. URL – www.the-internet.herokuapp.com/basic_auth Let us work and accept the below authentication popup.ExampleCode Implementation.import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver;    public class AuthnPopup{       public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe");       WebDriver driver = new ChromeDriver();       String u = "admin";   ... Read More

Scroll Down a Webpage in Selenium Using Java

Debomita Bhattacharjee
Updated on 18-Nov-2021 11:43:33

785 Views

We can scroll down a webpage in Selenium using Java. Selenium is unable to handle scrolling directly. It takes the help of the Javascript Executor to perform the scrolling action up to an element.First of all, we have to locate the element up to which we have to scroll. Next, we shall use the Javascript Executor to run the Javascript commands. The method executeScript is used to run Javascript commands in Selenium. We shall take the help of the scrollIntoView method in Javascript and pass true as an argument to the method.Syntax −WebElement elm = driver.findElement(By.name("name")); ((JavascriptExecutor) driver) .executeScript("arguments[0].scrollIntoView(true);", elm);Exampleimport ... Read More

Advertisements