The problem is the
$session->element('id', 'base_element')->element('xpath', '//div[@Class="descr"]')
does not work as expected according to the
http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/element
The expected result is 'test is passed' instead of 'test is failed'
Code to reproduce
index.php
session('firefox');
$session->open('http://xc53.crtdev.local/~aim/t.html');
$txt = $session->element('id', 'base_element')->element('xpath', '//div[
@Class="descr"]')->text();
print_r($txt);die;
```
?>
t.html for test1
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home :: Profile details :: Warning</title>
</head>
<body>
<div class="descr">test is failed</div>
<div id='base_element'></div>
<div class="descr">test is passed</div>
</body>
</html>
t.html for test2
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home :: Profile details :: Warning</title>
</head>
<body>
<div class="descr">test is failed</div>
<div id='base_element'>
<div class="descr">test is passed</div>
</div>
</body>
</html>
Output of the script is
[19:22][aim@rt:p4][/www/selenium_tests]$ php index.php
test is failed
[19:22][aim@rt:p4][/www/selenium_tests]$
The problem is the
$session->element('id', 'base_element')->element('xpath', '//div[@Class="descr"]')
does not work as expected according to the
http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/element
The expected result is 'test is passed' instead of 'test is failed'
Code to reproduce
index.php
session('firefox'); $session->open('http://xc53.crtdev.local/~aim/t.html'); $txt = $session->element('id', 'base_element')->element('xpath', '//div[@Class="descr"]')->text(); print_r($txt);die; ``` ?>t.html for test1
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home :: Profile details :: Warning</title>
</head>
<body>
<div class="descr">test is failed</div>
<div id='base_element'></div>
<div class="descr">test is passed</div>
</body>
</html>
t.html for test2
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home :: Profile details :: Warning</title>
</head>
<body>
<div class="descr">test is failed</div>
<div id='base_element'>
<div class="descr">test is passed</div>
</div>
</body>
</html>
Output of the script is
[19:22][aim@rt:p4][/www/selenium_tests]$ php index.php
test is failed
[19:22][aim@rt:p4][/www/selenium_tests]$