Retrieve an array of all list elements on the page

Assignment Help JAVA Programming
Reference no: EM13940066

Function testCountListElements should simply retrieve an array of all list (html tag li) elements on the page and assert that their total count is three. Utilize an XPath expression for retrieving the elements on the page and assertCount() when doing your assertion. XPath expressions starting with a double slash (ie: //) will locate elements regardless of document position.

/**
* Asserts that the count of list elements on the page is equal
* to three utilizing an xpath expression.
*/
public function testCountListElements() {

/**
*My guess, so far. I have only done Java/Junit before.
*$elements = $this->getSession()->element(array('using'=> WebDriver_Container::XPATH, 'value' => '//li*'));
*
*$this->assertCount(3, sizeof($elements));*/

}

If I were doing Java, it would be as below:

List <WebElement> elements = driver.findElements(By.xpath("//li*"));
assertCount(3, elements.size());

It does not matter what the webpage is and we do not net to worry about creating the session or WebDriver (I have that part covered).

I have just never done Php and I am not sure how to handle loading the array via xpath.

Reference no: EM13940066

Questions Cloud

What is the dollar amount of purchase of suits : What is the dollar amount of purchase of suits? Each suit has a cost of $80.
Assuming that the salaries of production managers : A sample of 9 production managers with over 15 years of experience has an average salary of $71,000 and a sample standard deviation of $18,000.
Creative analysis of the selected project : Outstanding well written critical and creative analysis of the implications of policy issues on creative practice. That is you have clearly presented a well-articulated argument about the connection between policy for creative practice and how pr..
What are the moral-ethics issues : 1. What are the moral/ethics issues? Identify them. 2. Was Harvard right to cap compensation?
Retrieve an array of all list elements on the page : Function testCountListElements should simply retrieve an array of all list (html tag li) elements on the page and assert that their total count is three
Effect on the monthly contribution margin : Although the Missouri Company has the capacity to produce 16,000 units per month, current plans call for monthly production and sales of only 10,000 units at $15 each. Costs per unit are as follows:
Principles of macroeconomics : Principles of Macroeconomics- As a result of the Great recession, the FDIC made changes to embolden consumer confidence. These include: ensuring in full all accounts which do not earn interest regardless of balance and raising the standard maximu..
Compute the additional profit that bandaleria would earn : Compute the contribution margin ratio. Using that ratio, compute the additional profit that Bandaleria would earn if sales were $50,000 more than expected.
Describe swot components : Describe SWOT Components - Discuss how you are going to improve the weaknesses, mitigate the threats and take advantage of the strengths and opportunities for the organization.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a guessing game

Create a guessing game where the user enters an integer between 1 and 10.

  Calculates the area of a triangle

Write a simple Java application which calculates the area of a triangle. Your application should ask the user to enter the base and height values of the triangle.

  Variable is named res and is used to input a resistanc

Assume the existence of the following Java GUI application. There are two text fields for user input. The first JTextField variable is named res and is used to input a resistance value in ohms. The second JTextField variable named cap is used to..

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Create dict letter frequencies that reads the file

createDictLetterFrequencies that reads the file and also takes a parameter n. This method should return a dictionary of dictionaries. The outer dictionary associates the previous n letters of a word with an inner dictionary, which indicates the frequ..

  Write a bag class with a generic type

Write a Bag class with a generic type. Write a class such as item that has a name and price - Add objects of item to the bag and find the average and the total of the price of all items in the bag.

  Traditionally-nutrition programs were targeted to indigent

Traditionally, nutrition programs were targeted to the indigent and poor populations in developing countries. Many of today's Americans are malnourished also, but they are glutted with a wealth of unhealthy foods and require a multidisciplinary appro..

  Class that stores information about a report

Create a class that stores information about a report containing multiple currency transactions in multiple currencies. This includes the name of the report and each of the transactions that occurred.

  Explain the use of file input and output in a java program

Getting input from the keyboard and sending output to the screen has limitations. If the amount of input data is large, it is inefficient to type it each time you run a program.

  Design a program that extends the definition of the class

Design a program that extends the definition of the class JFrame to display a window on the screen. Name your class PropertyTax1, title your window "Calculation of Property Taxes," set the window's width to 400 pixels and height to 300 pixels, and te..

  Constructing a simple flowchart that describes simple logic

Constructing a simple flowchart that describes simple logic flow through a program. Translating the flowchart into pseudo code. Creating a simple module, based on the pseudo code created in step 2, which accepts a parameter and returns a value.

  Program that allows users to enter a dollar amount

Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month. Then ask the user to enter a dollar amount for any number of checks written in a month, up to 50.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd