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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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