WebDriver supports Automating Dropdown and List controls utilizing a unique “Select” type as opposed to the WebElement group.

Let us develop a test for a Dropdown management. This evaluation call various approaches to choose alternatives in dropdown and after that will perform some basic tests.

For Selenium Webdriver file uploding click this link.

Sample Code:

@Test

public void testDropdown() {

//Get the Dropdown as a Select using its name attribute

Select make = new Select(driver.findElement(By.name(“make”)));

//Verify Dropdown does not support multiple selection

assertFalse(make.isMultiple());

//Verify Dropdown has four options for selection

assertEquals(4, make.getOptions().size());

//With Select class we can select an option in Dropdown using visible Text

make.selectByVisibleText(“Admin”);

assertEquals(“Admin”, make.getFirstSelectedOption().getText());

//or we can select an option in Dropdown using value attribute

make.selectByValue(“Manager”);

assertEquals(“Manager”, make.getFirstSelectedOption().getText());

//or we can select an option in Dropdown using index

make.selectByIndex(0);

assertEquals(“Contributor”, make.getFirstSelectedOption().getText());

}

Below is the Sample code for Selenium Webdriver training:

Click for Code

Selenium on Automation Framework Design

To design a framework we should focus on these variables.

  1. We must create UI Map
  2. Libraries for UI objects.
  3. Layout categories depending on use under evaluation.
  4. Plan for evaluation performance method of minimize time.
  5. Design report generation.
  6. Prepare measure suite and a Step table.
  7. Where needed prepare a Data set
  8. Layout Key Word Driven activity fixtures
  9. Layout and develop the code that is psudo.

Frame work has several kinds and most popular are the below

a.Keyword driven frame work

b.Data driven Framework

c.Hybrid Driven Frame work

Key Word driven framework

Key Word driven framework is an activity established test method used in execution and planing of automation.

Sample Keyword Driven Table:

Module: Login

Sl.No Element ID Action Data Goal
1. Txt_login Type 5_Kings
2. Txt_Password Type 84#nu2|
3. Txt_ConfirmPwd Type 84#nu2|
4. btn_Save Click Success Message

Data Driven Framework:

Data driven is the layout of input signals that are potential what may given by the end user. This may cover maximum likelihood of an input data. It may be Distribute sql or sheet. Pass and we must join the values to component or the specific area. 

The experienced individual on the job should designs the information. It can be even or a customer non technical person but should be familiar with end user future. For more on Frameworks click here

We need to plan the file path correctly.

More on this go here: http://seleniumidetutorials.com/

Hybrid Framework:

Hybrid Framework is only the group of some frame work on the basis of the framework programmer or the mix it can be called by us as hybrid framework.

Selenium IDE – parametrization

Parametrization is among the crucial area in Test automation. Develop and we must design the most mix of evaluation information to give as input signal. This can be among the primary reason we’re going to RC. But it may not be impossible in Selenium IDE training also.

Measures to invoke the data file in to Selenium IDE installation 

  1. Create (Copy and Paste) Following information in a notepad.

Key Word = “Selenium Automation Framework Layout”

  1. Save the file in JavaScript format (datapool.js)
  1. Start Selenium IDE and Choose –“>>Options–“>>Alternatives.
  1. Under Selenium IDE Extensions Browse the Saved .js file
  1. Click OK and Restart Selenium IDE.

Steps to access data from javascript file:

Parameterization
open http://www.google.co.in
storeEval Keyword Keyword
type id=lst-ib ${Keyword}
click name=btnG
pause 3000
assertTextPresent Selenium Automation: Selenium Automation Framework Design

 

Leave a Reply

Your email address will not be published. Required fields are marked *