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

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Modeling the caves

Assignment 2 Description:  You are a mighty warrior, and armed with your trusty bow and 3 arrows, you enter The Caves in search of the mighty Wumpus. If you shoot the Wumpus, you are victorious and the masses will praise you, but if you stumble upon ..

  Write an interface for an abstract method

Write an interface, PointingDevice, containing:  an abstract method, getXCoord that returns an int and an abstract method, getYCoord that returns an int.

  User session mgr - socket and thread programs

User Session Mgr - Socket and Thread Programs

  Javascript validation - cgi program

CGI mailer script form-mail.pl to your server's cgi-bin directory, and change the permissions on the script to make it executable - BMIS 310

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

  Write a java program in a netbeans project

Write a Java program in a NetBeans project

  Create java program to find number of days left in that year

Create a Java program called "DaysLeftInYear.java" that outputs the number of days left in that year. use the calendar class to represent dates. Use the DateFormat class to display the current date in the output.

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

  Write down java program for furniture company

Write down a Java program for the furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate price of table manufactured with chosen wood.

  Write various bindings to determine semantics

Write the various bindings that are required to determine the semantics when statement is executed. For each binding, indicate binding time used for language. Describe your answer.

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