Posts

Python Features

Python's features include − Easy-to-learn  − Python has few keywords, simple structure, and a clearly defined syntax. This allows the student to pick up the language quickly. Easy-to-read  − Python code is more clearly defined and visible to the eyes. Easy-to-maintain  − Python's source code is fairly easy-to-maintain. A broad standard library  − Python's bulk of the library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh. Interactive Mode  − Python has support for an interactive mode which allows interactive testing and debugging of snippets of code. Portable  − Python can run on a wide variety of hardware platforms and has the same interface on all platforms. Extendable  − You can add low-level modules to the Python interpreter. These modules enable programmers to add to or customize their tools to be more efficient. Databases  − Python provides interfaces to all major commercial databases...

Python-Overview

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This tutorial gives enough understanding on Python programming language. Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python is Interpreted  − Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP. Python is Interactive  − You can actually sit at a Python prompt and interact with the interpreter directly to write your programs. Python is Object-Oriented  − Python supports Object-Oriented style or...

Read it out for TESTNG before going for an iterview

How to run a group of test cases using TestNG? TestNG allows you to perform sophisticated groupings of test methods. Not only can you declare that methods belong to groups, but you can also specify groups that contain other groups. Then TestNG can be invoked and asked to include a certain set of groups (or regular expressions) while excluding another set.  This gives you maximum flexibility in how you partition your tests and doesn’t require you to recompile anything if you want to run two different sets of tests back to back. Groups are specified in your testng.xml file and can be found either under the <test> or <suite> tag. Groups specified in the <suite> tag apply to all the <test> tags underneath. @Test (groups = { "smokeTest", "functionalTest" }) public void loginTest(){ System.out.println("Logged in successfully"); }   How to create Group of Groups in TestNG? Groups can also inc...

Importance of testng.xml file

In a Selenium TestNG project, we use  testng.xml  file to configure the complete test suite in a single file. Some of the features are as follows. testng.xml file allows to include or exclude the execution of test methods and test groups It allows to pass parameters to the test cases Allows to add group dependencies Allows to add priorities to the test cases Allows to configure parallel execution of test cases Allows to parameterize the test cases 7. How to pass parameter through  testng.xml  file to a test case? We could define the parameters in the  testng.xml  file and then reference those parameters in the source files. Create a java test class, say,  ParameterizedTest. java  and add a test method say  parameterizedTest()  to the test class. This method takes a string as input parameter. Add the annotation @Parameters(“browser”) to this method. 1 2 3 4 5 6 7 8 9 10 11 12 // ...

Annotations available in TestNG

@BeforeTest @AfterTest @BeforeClass @AfterClass @BeforeMethod @AfterMethod @BeforeSuite @AfterSuite @BeforeGroups @AfterGroups @Test

Advantages of TestNG

TestNG provides parallel execution of test methods It allows to define dependency of one test method over other method It allows to assign priority to test methods It allows grouping of test methods into test groups It has support for parameterizing test cases using @Parameters annotation It allows data driven testing using @DataProvider annotation It has different assertions that helps in checking the expected and actual results Detailed (HTML) reports

What is Xpath "Here is the answer" with all type

What is XPath XPath is defined as  XML path .  It is a syntax or language for finding any element on the web page using XML path expression . XPath is used to find the location of any element on a webpage using HTML DOM structure. The basic format of XPath is explained below. Syntax for XPath: XPath contains the path of the element situated at the web page. Standard syntax for creating XPath is. Xpath=//tagname[@attribute='value'] // :  Select current node. Tagname:  Tagname of the particular node. @:  Select attribute. Attribute:  Attribute name of the node. Value:  Value of the attribute. Types of X-path There are two types of XPath: 1) Absolute XPath . 2) Relative XPath . Absolute XPath  : It is the direct way to find the element, but the disadvantage of the absolute XPath is that if there are any changes made in the path of the element then that XPath gets failed. The key characteristic of XPath is that it begi...