Elements from a html document

Assignment Help JAVA Programming
Reference no: EM1379123

Function test Count List Elements 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: EM1379123

Questions Cloud

Multiple choice java programming questions : Determine which of the following may be a violation of information hiding if inserted for the comment above?
Role in business according to lizzie lewis : The role in business according to Lizzie Lewis means the selling of goods and service for a profit with quality.
Java script program for song : Construct a JavaScript program that declares and prints an array that includes at least twenty of your favorite songs.
Construct java program named collegelist : Construct a set of classes for a college to use in many student service and personnel applications. Classes you require to design include following:
Elements from a html document : Function test Count List Elements should simply retrieve an array of all list elements on the page and assert that their total count is 3.
Fixing errors in a java program : You coded the following on line ten of the class MyApplet.java:
Sequence of method in vector class : Construct a Vector class implementing a number of vector operations as methods along with a testing program to verify the class is working.
Java program to find a value at in index : Construct a main class named Array Program that generates an array of 50-integers, all ranging from one to one hundred.
Discuss primary financial statements : Discuss primary financial statements published by a corporation, the various classifications used in a balance sheet-What is the purpose of a Balance Sheet? What information does it provide?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a secure parts inventory catalog system

You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system, and when satisfied, presents the catalog of items currently available in t..

  Java servlet uses doget to return markup document

Write down Java servlet which uses doGet to return markup document which provides your name, e-mail address, and mailing address along with a brief autobiography.

  Write a java program to compute salary

Write a Java program which computes the Salary for a given number of employees. The program prompts user to enter n the number of employees.

  Implementation of memory management

Implementation of memory management

  Function using javascript syntax to compute gross pay

Write a function using JavaScript syntax to compute a person's gross pay for a week. The function must receive the number of hours worked and the rate of pay per hour.

  Data structures and algorithms

Code analysis and programming.

  Create java application which creates random phone number

Create and implement Java application which creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output.

  Implementation of encryption and steganography in java

This is a project report showing the essential details and coding structures related with the implementation of encryption techniques and steganography in JAVA.

  Write java programming to show number of credits for course

Write the java programming to solve following problem. We are given a student's marks in Calculus 1, CS1, and Physics 1 (each mark being between 0 and 100) also number of credits for each course.

  Implement a fish-lake simulation

Implement a Fish/Lake simulation similar to the previous assignment. You will then make adjustments to accommodate class hierarchies and make use of inheritance as well as a JAVA interface.

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

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