There are two types of HTML tables published on the web- Static tables : Data is static i.e. Number of rows and columns are fixed. Dynamic tables : Data is dynamic i.e. Number of rows and columns are NOT fixed.Handling static table is easy, but dynamic table is a little bit difficult as rows and columns are not constant. Using X-Path to Locate Web Table Elements Before we locate web element, first let's understands- What is a web element? Web elements are nothing but HTML elements like textbox, dropdowns radio buttons, submit buttons, etc. These HTML elements are written with start tag and ends with an end tag. For Example, <p> My First HTML Document </p>. Steps for getting X-path of web element that we want to locate. Step 1) In Chrome, Go to http://money.rediff.com/gainers/bsc/daily/groupa Step 2) Right click on web element whose x-path is to be fetched. In our case, right click on "Company" Se...
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...
In automation, when we have multiple windows in any web application, the activity may need to switch control among several windows from one to other in order to complete the operation. After completion of the operation, it has to return to the main window i.e. parent window. We will see this further in the article with an example. In selenium web driver there are methods through which we can handle multiple windows. Driver.getWindowHandles(); To handle all opened windows by web driver, we can use "Driver.getWindowHandles()" and then we can switch window from one window to another in a web application. Its return type is Iterator<String>. Driver.getWindowHandle(); When the site opens, we need to handle the main window by driver.getWindowHandle() . This will handle the current window that uniquely identifies it within this driver instance. Its return type is String.
Comments
Post a Comment