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...
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 // ...
Difference between Selenium RC and Webdriver Before the advent of WebDriver in 2006, there was another, automation tool called Selenium Remote Control. Both WebDriver and Selenium RC have following features: · They both allow you to use a programming language in designing your test scripts. · They both allow you to run your tests against different browsers. So how do they differ? Let us discuss the answers. 1. Architecture WebDriver's architecture is simpler than Selenium RC's . · It controls the browser from the OS level · All you need are your programming language's IDE (which contains your Selenium commands) and a browser. Selenium RC's architecture is way more complicated. · You f...
Comments
Post a Comment