Web Stories - Articles - Questions - Post - Experiences
menu search
brightness_auto
Add Knowledge - Updates - Promotion
more_vert
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert

Many Selenium WebDriver experts commonly employ static class variables, and WebDriver is widely used as a static reference variable.

  • They benefit from static WebDriver since they don't have to declare and initialise local WebDriver objects in numerous classes to maintain the same reference, and they can access WebDriver values from a single location.
  • It also enables them to disregard NullPointerException for driver instances, which is a common difficulty among Selenium WebDriver newbies.
  • They make WebDriver static so that they can use the same reference in every browser without issue.

Selenium test automation does not require a static driver or static methods. They cause more difficulties than they solve. Breaking encapsulation, making things changeable, and encouraging procedural code are examples.

thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike

Related questions

Searched so many websites? Did not find the exact answer of your query? No worries, we will try to answer. ImplicitWait: Where ever you write bel...
What is the technical difference between ImplicitlyWait & ExplicitWait in selenium webdriver?
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
What are the Challenges you faced in Selenium automation?
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
Read Story...
share
There are several cases which you can easily solve by using javascriptExecutor. The arguments[0] means the webElement passed in the executeS...
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
I am working in a multi national company. We are using TestNG6.9.5 based selenium java framework. Somehow my local setup deleted and now I have to re-...
I am not able to find TestNG6.9.5 in ecllipse, dl.bintray.com is also not working, what to do ?
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Ads by Zaankari™ Portal
Selenium is an automation testing framework for web and mobile apps. Selenium scripts are written in java/php/ruby/c# etc  e.g. Registration pag...
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Chitkara University, located in Punjab, India, is a renowned institution known for its commitment to providing quality education and fostering innovat...
Chitkara University: Nurturing Excellence in Education and Innovation
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Changes were made in the new policy formed in 2020 called as New Education Policy (NEP) - 2020 Dr. K. Kasturirangan was the chairperson of this policy...
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Ads by Zaankari™ Portal
When a person who is constantly looking for a job is unable to obtain work, they are said to be unemployed. Unemployment is regarded as a leading sig...
What are the causes of Unemployment in India?
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
Read Story...
share
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share

Most popular questions within the last 4 days

Welcome to Zaankari portal, where you can ask and read questions/answers and stories. Add Questions/Stories/Posts - Earn Points !
...