Can anyone tell what are Parametermized Fixtures and what are its usage?

0 votes
Can anyone tell what are Parametermized Fixtures and what are its usage?
Aug 22, 2019 in Selenium by Varsha
82 views

1 answer to this question.

0 votes

Hey Varhsa, Parameterized Fixtures are used to execute fixture function multiple times along with the execution of dependent tests. Parameterized Fixtures are widely used to write exhaustive test functions. Parameterization of a fixture allows you to add params to a function like driver_init() which can launch Chrome as well as Firefox browsers if defined this way:

@pytest.fixture(params=["chrome", "firefox"],scope="class")
def driver_init(request):
    from selenium import webdriver
    if request.param == "chrome":
        web_driver = webdriver.Chrome()
    if request.param == "firefox":
        web_driver = webdriver.Firefox()
    request.cls.driver = web_driver
    yield
    web_driver.close()
answered Aug 23, 2019 by Abha
• 27,930 points

Related Questions In Selenium

0 votes
1 answer

What is Log4j and what are its advantages??

Hi Benny, Log4j is a brilliant logging API ...READ MORE

answered May 21, 2019 in Selenium by Anvi
• 14,110 points
409 views
0 votes
1 answer
0 votes
1 answer

What is Apache ANT and what are its features?

Hello Deshdeepak, Ant is a Java-based Open-Source build tool ...READ MORE

answered Jul 17, 2019 in Selenium by Abha
• 27,930 points
171 views
0 votes
1 answer

What is Behavior Driven Development (BDD) and what are its features?

Behavior-driven development (BDD) is an Agile software development methodology within which an application is ...READ MORE

answered Nov 27, 2019 in Selenium by Sirajul
• 57,940 points
166 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
3,554 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,563 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,611 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
2,898 views
0 votes
1 answer
0 votes
2 answers

What is a headless browser in automation testing and what are it's benefits?

Hi Sanaya, a headless browser is a web browser ...READ MORE

answered Aug 1, 2019 in Selenium by Abha
• 27,930 points
1,172 views