Debomita Bhattacharjee has Published 867 Articles

How to refresh a browser then navigate to a new page with Javascript executor in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Jul-2020 15:16:02

836 Views

We can refresh a page and then navigate to a new page from the current page with Javascript executor in Selenium. Javascript is a language used for scripting and runs on the client side (on the browser). Selenium gives default methods to work with Javascript.Syntaxdriver.execute_script('history.go[0]') javaS = "window.location = 'https://www.tutorialspoint.com/index.htm'" ... Read More

How to get the title and URL of a webpage with Javascript executor in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Jul-2020 15:13:43

765 Views

We can get the title and URL of a webpage with Javascript executor in Selenium. Javascript is a language used for scripting and runs on the client side (on the browser). Selenium gives default methods to work with Javascript.Syntaxprint(driver.execute_script('return document.title')) print(driver.execute_script('return document.URL'))There are couple of methods of working with Javascript ... Read More

How to get the inner text of a webpage with a Javascript executor in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Jul-2020 15:10:51

2K+ Views

We can get the inner text of a webpage with a Javascript executor in Selenium. Javascript is a language used for scripting and runs on the client side (on the browser). Selenium gives default methods to work with Javascript.Syntaxprint(driver.execute_script('return document.documentElement.innerText'))There are couple of methods of working with Javascript −Javascript execution ... Read More

How to perform vertical scrolling of a webpage with Javascript executor in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Jul-2020 14:54:54

431 Views

We can perform vertical scrolling of a webpage with Javascript executor in Selenium. Javascript is a language used for scripting and runs on the client side (on the browser). Selenium gives default methods to work with Javascript.Syntaxdriver.execute_script("window.scrollTo(0, document.body.scrollHeight);")There are couple of methods of working with Javascript −Javascript execution at document ... Read More

How to click on a button with Javascript executor in Selenium with python?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 28-Jul-2020 14:49:42

8K+ Views

We can click on a button with a Javascript executor in Selenium. Javascript is a language used for scripting and runs on the client side (on the browser). Selenium gives default methods to work with Javascript.Syntaxb = driver.find_element_by_xpath("//input[starts-with(@class, 'gsc')]") driver.execute_script("arguments[0].click();", b)There are couple of methods by which Javascript can be ... Read More

How to do single data parameterization without Examples in Cucumber?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 11-Jun-2020 13:20:17

270 Views

We can do single data parametrization without using Examples in Cucumber by passing the value directly in the feature file.ExampleFeature file.Feature: Tutorialpoint Job page Scenario: Tutorialpoint job page look and fee Given Launch site https://www.tutorialspoint.com/about/about_careers.htm Then Verify the tabs on the pageURL is directly passed in the Given statement in ... Read More

What do you mean by glue in Cucumber?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 11-Jun-2020 13:19:23

6K+ Views

The glue is a part of Cucumber options that describes the location and path of the step definition file.ExampleTest Runner file.import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import cucumber.api.testng.AbstractTestNGCucumberTests; @CucumberOptions(    features = "src/test/java/features",    glue="stepDefinations" ) public class TestRunner extends AbstractTestNGCucumberTests { }Read More

How do you use regular expressions in Cucumber?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 11-Jun-2020 13:16:57

3K+ Views

We can use regular expressions in Cucumber for selecting a collection of similar statements in the feature file.Examplefeature fileFeature: Exam Syllabus Scenario Outline: Summer and Winter Exam Schedule Given Exam time table in summer season Given Mathematics and Physics Syllabus Given Exam time table in winter seasonThe step Definition file ... Read More

How to run precondition and postcondition test methods in Cucumber?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 11-Jun-2020 13:13:43

2K+ Views

We can run precondition and postcondition test methods with the help of @Before and @After hooks in Cucumber.ExampleFeature file.Feature: Transaction Table Scenario: Verify the monthly transactions Given User is on the Payment PageStep Definition has methods with hooks @Before and @After. The test method with hook @Before will be executed ... Read More

How to include and exclude test methods from a set of test cases inCucumber?

Debomita Bhattacharjee

Debomita Bhattacharjee

Updated on 11-Jun-2020 13:12:05

435 Views

We can include and exclude test methods from a set of test cases in Cucumber by tagging scenarios in the feature file.ExampleFeature file.@Tutorialspoint Testing Feature: Login Feature Testing @Smoke Scenario: Home Page Testing Given User is in home page @CodingModule Scenario: Coding Module Testing Given User is in Coding Module ... Read More

Advertisements