TestNG has very good feature to enable or disable selenium webdriver @Test method. During test execution, If you do not wants to execute specific @Test method from test class then you can directly disable It using TestNG property enabled = false. It Is something like excluding @Test method from execution as described In THIS POST.
A blog on Selenium tutorial, Selenium webdriver tutorial, Selenium IDE tutorial, Appium Tutorial, Selenium Grid Tutorial, Jmeter Tutorial.
TestNG With Selenium WebDriver Interview Questions And Answers
Part 15
68 : What Is the usage of testng.xml file?
Answer : In selenium WebDriver software testing tool, We are using testng.xml file to configure our whole test suite In single file. Few of the tasks which we can specify In testng.xml file are as bellow.
Use Of preserve-order In TestNG With Selenium WebDriver
preserve-order Is very Important attribute In TestNG. In Selenium WebDriver test execution, Many times peoples are complaining like my test cases execution not runs In correct sequence as given In testng.xml file but they are being executed In random sequence(unpredictable order). Actually they have copy pasted testng.xml file from somewhere with attribute preserve-order="fasle" but they don't know meaning of this attribute. Let me try to explain you meaning of this attribute.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
Selenium WebDriver with TestNG Interview Questions With Answers
Part 14
63 : What Is TestNG?
Answer : TestNG Is Open Source(Freeware) framework which Is Inspired from NUnit and JUnit with Introducing few new features and functionality compared to NUnit and JUnit to make It easy to use and more powerful.
Using Single @DataProvider Method To Store All WebDriver Test Case Data
We have learnt how to create and store multiple @DataProvider methods In single class file called dataProvider_Repository.java and then we can use those data In different test case execution as described In THIS PAGE. Using this, We can manage data of all test cases very easily In single file and If you wants to modify test data of any test case, You have to modify only single file.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
JUnit With Selenium WebDriver Interview Questions And Answers
Part 13
58 : Tell me main features of JUnit.
Answer : JUnit features are as bellow.
- JUnit Is unit software testing framework. So It helps software developers to create and run unit test cases very easily.
Store And Access All DataProviders From Single File For WebDriver Test Cases
We have already learnt how to create and use testng data providers In selenium webdriver test cases In THIS POST. Also we have used testng data providers In Selenium WebDriver Data Driven Framework creation so all you are now very familiar with testng data providers and how to use them In our automation test case creation.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
Selenium WebDriver With JUnit Interview Questions With Answers Part 12
Part 12
53 : Which Is the latest version of JUnit.
Answer : Current latest version of JUnit Is 4.12-beta-2. This can change In future. To check latest released version of JUnit, You can Visit JUnit Official WebSite.
Executing Selenium WebDriver Test Classes Parallel Using TestNG
Sometimes you need to execute multiple test cases at same time to save test execution time. TestNG has very good feature to execute test cases/classes In parallel to each other means you can execute two different test cases In two different windows of same browser simultaneously. If you remember, We have already learnt how to execute two different tests In two different browsers(Example : Firefox and Google Chrome) simultaneously In THIS POST.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
Interview Questions For Selenium WebDriver Part 11
Part 11
48 : Can you tell me a syntax to close current webdriver Instance and to close all opened webdriver Instances?
Answer :
Yes, To close current WebDriver Instance, We can use Close() method as bellow.
Answer :
Yes, To close current WebDriver Instance, We can use Close() method as bellow.
Using dependsOnMethods Of TestNG In Selenium WebDriver Test Case
Earlier in previous post, We have learnt how to set test execution priority of WebDriver test cases If you have multiple tests In same class. TestNG has one more very useful feature of setting test execution dependency. Depends on method in testng means If one @Test method fails or skipped from execution then It's dependent @Test method must not be executed. So you can set test execution dependency using dependsonmethods in selenium.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
Interview Questions For Selenium WebDriver Part 10
Part 10
46 : Can we perform drag and drop operation In Selenium WebDriver? Tell me a syntax to drag X element and drop It On Y element.
Answer : Yes, We can perform drag and drop operation using selenium webdriver software testing tool's Advanced User Interactions API. Syntax Is like below.
Set Priority For Selenium WebDriver TestNG @Test Method Execution
We can set test execution priority for selenium WebDriver @Test annotation methods. If there Is single @Test annotation method In your test class then you do not need to set test execution priority but supposing you have multiple @Test annotation methods In single test class then many of you may face Issue like @Test method's execution sequence Is different than the actual sequence.
Related Articles :
Selenium 2,
selenium webdriver,
WebDriver,
WebDriver Examples,
webdriver tutorials
Subscribe to:
Posts (Atom)