Empty rows with datatables / Bootstrap table - twitter-bootstrap-3

I don't understand the behavior of my bootstrap 3.3.7 + datatables 1.10.15 table.
Here is my initial HTML Table :
<table id="types-2" class="table-bordered table-striped table-condensed">
<thead>
<tr>
<th class="both" data-field="Type" data-sortable="true">Type</th>
<th class="both" data-field="Name" data-sortable="true">City</th>
<th class="both" data-field="City" data-sortable="true">‰ city</th>
<th class="both" data-field="Department" data-sortable="true">‰ department </th>
<th class="both" data-field="Region" data-sortable="true">‰ region</th>
</tr>
</thead>
<tbody>
<tr>
<td>Case 1</td>
<td>782 </td>
<td>13.84‰ </td>
<td>18.38‰ </td>
<td>24.25‰ </td>
</tr>
<tr>
<td>Case 2</td>
<td>267 </td>
<td>4.73‰ </td>
<td>5.37‰ </td>
<td>7.87‰ </td>
</tr>
<tr>
<td>Case 3 </td>
<td>191 </td>
<td>3.38‰ </td>
<td>4.27‰ </td>
<td>4.02‰ </td>
</tr>
<tr>
<td>Case 4</td>
<td>144 </td>
<td>0.04‰ </td>
<td>0.29‰ </td>
<td>0.24‰ </td>
</tr>
</tbody>
</table>
I'm using this script in order to hide pagination and search, to order by colomn 1 desc value, and to be responsive and to display directly all the rows.
<script>
jQuery(document).ready(function() {
jQuery('#types-2').DataTable( {
"bPaginate": false,
"bInfo" : false,
"responsive": true,
"searching": false,
"aaSorting": [[1,'desc']],
responsive: {
details: {
display: jQuery.fn.dataTable.Responsive.display.childRowImmediate,
type: ''
}
}
} );
} );
</script>
What I can't figure is why the script is adding two empty div class rows at the begining and the end of the table :
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm-6"></div>
</div>
[...]
<div class="row">
<div class="col-sm-5"></div>
<div class="col-sm-7"></div>
</div>
The full render is :
<div id="types-2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm-6"></div>
</div>
<div class="row">
<div class="col-sm-12">
<table id="types-2" class="table-bordered table-striped table-condensed dataTable no-footer dtr-" role="grid" style="width: 605px;">
<thead>
<tr role="row">
<th class="both sorting" data-sortable="true" data-field="Type" tabindex="0" aria-controls="types-2" rowspan="1" colspan="1" style="width: 114px;" aria-label="Délit: activate to sort column ascending">Délit</th>
<th class="both sorting_desc" data-sortable="true" data-field="Name" tabindex="0" aria-controls="types-2" rowspan="1" colspan="1" style="width: 127px;" aria-sort="descending" aria-label="Abrets en Dauphiné : activate to sort column ascending">Abrets en Dauphiné
</th>
<th class="both sorting" data-sortable="true" data-field="City" tabindex="0" aria-controls="types-2" rowspan="1" colspan="1" style="width: 140px;" aria-label="‰ Abrets en Dauphiné: activate to sort column ascending">‰ Abrets en Dauphiné
</th>
<th class="both sorting" data-sortable="true" data-field="Department" tabindex="0" aria-controls="types-2" rowspan="1" colspan="1" style="width: 48px;" aria-label="‰ Isère : activate to sort column ascending">‰ Isère
</th>
<th class="both sorting" data-sortable="true" data-field="Region" tabindex="0" aria-controls="types-2" rowspan="1" colspan="1" style="width: 101px;" aria-label="‰ Rhône-Alpes: activate to sort column ascending">‰ Rhône-Alpes
</th>
</tr>
</thead>
<tbody>
<tr class="odd" role="row">
<td tabindex="0">Case 1</td>
<td class="sorting_1">782 </td>
<td>13.84‰ </td>
<td>18.38‰ </td>
<td>24.25‰ </td>
</tr>
<tr class="even" role="row">
<td tabindex="0">Case 2</td>
<td class="sorting_1">267 </td>
<td>4.73‰ </td>
<td>5.37‰ </td>
<td>7.87‰ </td>
</tr>
<tr class="odd" role="row">
<td tabindex="0">Case 3</td>
<td class="sorting_1">191 </td>
<td>3.38‰ </td>
<td>4.27‰ </td>
<td>4.02‰ </td>
</tr>
<tr class="even" role="row">
<td tabindex="0">Case 4 </td>
<td class="sorting_1">144 </td>
<td>0.04‰ </td>
<td>0.29‰ </td>
<td>0.24‰ </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-sm-5"></div>
<div class="col-sm-7"></div>
</div>
</div>
I can't figure where these additional 2 div class rows come from. Do you have any clue and how can I prevent them to appear (except display:none them)
Thanks.

It is added by default value for dom option when using Bootstrap styling.
If you're not using search, pagination and info controls, you can override the default layout with the following option.
dom: 'rt'
See official documentation for more information.

Related

remove bordering from <tfoot element

I have created this table in my Qweb report and as you can see this table has borders. But how can I remove border for <tfoot element only? It should be bordered on <thead and <tbody.
Do I need to do it with custom CSS somehow?
<table style="border-color:grey;" class="table-bordered table-sm o_main_table" name="moves_table">
<thead>
<tr>
<th>No</th>
<th>Description</th>
<th class="text-center">Code</th>
<th class="text-right">Units</th>
<th class="text-right">Quantity</th>
<th class="text-right">Package quantity</th>
<th class="text-right">Net weight (kg)</th>
<th class="text-right">Weight incl. packaging</th>
<th class="text-right">Type of package</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.move_ids_without_package" t-as="l">
<td class="text-center">
<span t-esc="l_index + 1" />
</td>
<td>
<span t-field="l.name"/>
</td>
<td>
<span t-field="l.product_id.default_code"/>
</td>
<td class="text-right">
<span t-field="l.product_uom.name"/>
</td>
<td class="text-right">
<span t-esc="'%.2f'%(l.product_uom_qty)"/>
</td>
<td class="text-right">
<span t-esc="'%.2f'%(l.product_uom_qty)"/>
</td>
<td class="text-right">
<span t-esc="'%.2f'%(l.product_uom_qty)"/>
</td>
<td class="text-right">
<span t-esc="'%.2f'%(l.product_uom_qty)"/>
</td>
<td class="text-right">
<span t-esc="'%.2f'%(l.product_uom_qty)"/>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td class="text-right"><span><strong>Total amount</strong></span></td>
<td class="text-right"><span t-esc="sum(o.move_ids_without_package.mapped('product_uom_qty'))"/></td>
<td class="text-right"><span t-esc="sum(o.move_ids_without_package.mapped('product_uom_qty'))"/></td>
<td class="text-right"><span t-esc="sum(o.move_ids_without_package.mapped('product_uom_qty'))"/></td>
<td class="text-right"><span t-esc="sum(o.move_ids_without_package.mapped('product_uom_qty'))"/></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="text-right"><span><strong>Total Weight</strong></span></td>
<td></td>
<td></td>
<td></td>
<td class="text-right"><span t-esc="sum(o.move_ids_without_package.mapped('product_uom_qty'))"/></td>
</tr>
</tfoot>
</table>
I suggest you do this the right way using css file, not style attributes because if you need this table, in another report you are going to repeat your self a lot and you are going to define style attribute in every td tag inside tfoo tag:
create and add css file to reports:
<template id="assets_common" name="Table no foot border" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">
<link href="/your_folder_name/static/src/css/table_report_css.css" rel="stylesheet"/>
</xpath>
</template>
In your table_report_css.css file use a special class to distinct your table no-footer-border and gray-border to make border gray:
/* notice the table should have this two class */
.table-bordered.gray-border {
border-color:grey;
}
/* hide tr border inside tfoo I think this is not needed */
.table-bordered.no-footer-border tfoo tr{
border: border: none;
}
/* hide border td border inside tfoo tag this is required */
.table-bordered.no-footer-border tfoo td{
border: border: none;
}
Now in your template this two class to your table tag add table-bordered,gray-border and no-footer-border classes:
<!-- remove the style -->
<table class="table-bordered table-sm o_main_table gray-border no-footer-border" name="moves_table">
Note: don't forget to add the XML file that extends the report_assets_common to manifest, when you edit the css file no need to restart the server or upgrade your module. and this is for Odoo version >= 11.0, in < 11.0 the template of report assets is report.assets_common.

How can select (or click) the button in table

I have a table as below with two buttons, how can I select the button for the 'FIRST' row?
<table id="comms-table" class="table table-condensed">
<tbody>
<tr><th class="bordered" style="text-align: center;" width="50">Status</th><th class="bordered" width="130">Component</th><th class="bordered">Last heart-beat</th></tr>
<tr class="data_row">
<td style="text-align: center;"><button class="btn btn-mini btn-success"> </button></td>
<td class="bordered">FIRST</td>
<td class="bordered">5 seconds ago</td>
</tr>
<tr class="data_row">
<td style="text-align: center;"><button class="btn btn-mini btn-success"> </button></td>
<td class="bordered">SECOND</td>
<td class="bordered">17 seconds ago</td>
</tr>
</tbody>
</table>
Try this:
WebElement we = driver.findElement(By.xpath("//*[contains(text(),'FIRST')]/preceding::button[1]"));
we.click();

Print all lines from account.invoice.line model

I created a new template for printing, and i want to customize it so it prints all the lines from account.invoice.line model. Is there a way you can do that. Here is the code of the template so far.
<t t-name="account.specifikacioni_report_document">
<t t-call="report.external_layout">
<div class="page">
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Quantity</th>
<th class="text-right">Unit Price</th>
<th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line" t-as="l">
<td>
<span t-field="l.name"/>
</td>
<td>
<span t-field="l.quantity"/>
<span t-field="l.uos_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td class="text-right" groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal" t-field-options="{"widget": "monetary", "display_currency": "o.currency_id"}"/>
</td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
This prints invoice lines for one invoice cause I copied the account.report_invoice_document and just edited it, but how can I list all invoice lines here not only the invoice lines for an invoice
You can follow the report_invoice.xml to print the lines.
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Quantity</th>
<th class="text-right">Unit Price</th>
<th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line" t-as="l">
<td><span t-field="l.name"/></td>
<td>
<span t-field="l.quantity"/>
<span t-field="l.uos_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td class="text-right" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</tbody>
</table>

selenium not finding correct link using xpath

I'm trying to delete click on link generated by a previous test (a delete link) but I'm having great difficulty with xpath
Here is the error I am receiving
Invalid response while accessing the Selenium Server at 'http://localhost:4444/s
elenium-server/driver/': ERROR: Element xpath=(//td[normalize-space() ='Test tit
le 2']/following-sibling::td[3]/descendant::a[.='delete']) not found
here is my test
public function testdeleteStationTestCase()
{
$this->open("/upd8r_new/");
$this->click("css=a > img");
$this->waitForPageToLoad("30000");
$this->type("name=username", "glass2");
$this->type("name=password", "glass2");
$this->click("name=submit");
sleep(1);
$this->click("xpath=(//td[normalize-space() ='Test title 2']/following-sibling::td[3]/a[.='delete'])");
//$this->click("xpath=(//td[normalize-space() ='Test title 2']/following-sibling::td[3]/descendant::a[.='delete'][1])");
sleep(1);
$this->assertTrue($this->isTextPresent("Station deleted!"),"Station Deleted");
}
as you can see my commented out line i have been trying all sorts of combinations to get the test to run-
here is the html page I am testing against- i have added a line of text where I am trying to click
<body>
<!-- social media header -->
<div class="main">
<div class="header">
Central Control Panel
</div>
<div class="logo">
<img src="http://localhost/upd8r_new/imgs/loyalty_connect2.png"/>
</div>
<div style="clear:both"></div>
<ul class="Menu" id="maintab">
<li class="selected" rel="home">HOME </li>
<li rel="retail">
RETAIL </li>
<li rel="stats"> STATS</li>
<li
rel="social_media_settings"> SETTINGS</li>
<li rel="logout">LOGOUT </li>
</ul>
<div style="clear:both"></div>
<div style="text-align:left;width:980px;height:40px;background-color:#0E477A;margin:auto;padding-top:0px;">
<div style="width:700px;text-align:left;padding-left:10px;float:left">
<div id="logout" class="submenustyle">
</div>
<div id="retail" class="submenustyle">
<ul class="sub_menu">
<li>USERS</li>
<li>COMPETITIONS</li>
</ul>
</div>
<div id="home" class="submenustyle">
<ul class="sub_menu">
<li>ADD LIKESTATION</li>
<li>ADD PICSTATION</li>
<li>ADD VIDSTATION</li>
</ul>
</div>
<div id="socialmedia_users" class="submenustyle">
</div>
<div id="stats" class="submenustyle">
<ul class="sub_menu">
<li>STATS HOME</li>
<li>FACEBOOK STATS</li>
</ul>
</div>
<div id="social_media_settings" class="submenustyle">
<ul class="sub_menu">
<li>SETTINGS HOME</li>
<li>NETWORKS TO USE</li>
<li>PRE REGISTRATION</li>
<li>
APP SETTINGS
</li>
</ul>
</div>
</div>
<div style="float:right;font-weight:bold;color:#fff;margin-top:12px;margin-right: 20px;">
Logged In As: glass2 </div>
</div>
<div style="clear:both"></div>
<div style="padding-top:30px;padding-left:10px">Station deleted! </div>
<div style="padding-left:10px">
<table width="700px" align="left" style="text-align:left;">
<tr>
<td style="font-weight:bold">Pre-Registration</td>
<td>http://localhost/upd8r_new/retail/register/80</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="800px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="6" STYLE="text-align:center;font-weight:bold">LIKESTATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="10%">STATION ID</td>
<td width="32%">STATION NAME</td>
<td width="25%">LINK TITLE</td>
<td width="10%">STATION STATS</td>
<td width="15%">LAST POST</td>
<td width="8%"></td>
</tr>
<tr>
<td>gla20311344 </td>
<td>http://localhost/upd8r_new/socialmedia/edit/gla20311344 </td>
<td>Webcast </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2084629867 </td>
<td>http://localhost/upd8r_new/socialmedia/edit/gla2084629867 </td>
<td>tes this link title3 </td>
<td>STATS </td>
<td>4 weeks ago</td>
<td>delete</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="620px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="5" STYLE="text-align:center;font-weight:bold">FACEBOOK PIC STATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="15%">STATION ID</td>
<td width="50%">STATION TITLE</td>
<td width="10%">STATION STATS</td>
<td width="15%">LAST POST</td>
<td width="10%"></td>
</tr>
<tr>
<td>gla1079978359 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>**link I'm trying to click**delete</td>
</tr>
<tr>
<td>gla1229158969 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1256364596 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1529784490 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla159062284 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla175038477 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1777127061 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla180142977 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1950664292 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla1971709701 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2028774169 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2035285297 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2072665757 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2115042517 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla2141659529 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla4705592 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla565900575 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla608150382 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
<tr>
<td>gla979271929 </td>
<td>Test title 2 </td>
<td>STATS </td>
<td>0</td>
<td>delete</td>
</tr>
</table>
<div style="clear:both"></div>
<table width="520px" align="left" style="text-align:left;">
<tr style="font-weight:bold;background-color:#f1f1f1">
<td colspan="4" STYLE="text-align:center;font-weight:bold">FACEBOOK VIDEO STATIONS</td>
</tr>
<tr style="font-weight:bold;background-color:#f1f1f1">
<td width="20%">STATION ID</td>
<td width="60%">STATION TITLE</td>
<td width="60%">STATION STATS</td>
<td width="20%"></td>
</tr>
</table>
<div style="clear:both"></div>
</div>
</div>
<div class="footer">
<div style="float:left;padding-top:20px;padding-left:20px;font-size:10px;font-family:arial"></div>
<div style="padding-top:20px;float:right;padding-right:30px;"><img src="http://localhost/upd8r_new/imgs/excelerated.jpg"/></div>
</div>
</body>
</html>
Your problem is in sleep(1);
In this place instead of sleep(1); you should use this:
$this->waitForCondition("selenium.isElementPresent(\'css=table:contains(\'FACEBOOK PIC STATIONS\') a:contains(\'delete\')\')", "20000");
And by the way, while you use selenium RC you can reach your delete link with this css (with webdriver it will not work as :contains is not a part of css spec):
$this->click("css=table:contains('FACEBOOK PIC STATIONS') a:contains('delete')");
Also replace all sleep(1); with appropriate waitForCondition commands
Install "XPath Checker 4.4" add-ons in Firefox. So for that object you will get proper xpath using this add-ons..
So,
click xpath=xpath for that object

Selenium RC - Having difficulty with Selenium IDE to find a table cell

I hope someone here can help me. Im using selenium to test a page that has an image which when click displays a calendar. I can get as far as clicking the image using
browser.click("//center/table/tbody/tr/td[1]/a/img")
I got the above path by using the Selenium IDE. The problem is once i click the above image the Selenium IDE does not record what i have clicked after the calendar is shown.
Here is the code for the image button
<INPUT size='8' CLASS="field-date" TYPE="text" NAME="endQtrDate" VALUE="01/10/2004" ID="endQtrDate" onBlur="this.value=validateFieldValue(this.value,'date_error','endQtrDate',this.form)" onFocus="this.select()" TITLE="Enter date in format dd/mm/yyyy" />
<IMG ALIGN="absmiddle" ALT="Press to show calendar picker" NAME="calendarButton" SRC="../images/buttons/small/calendar.gif" onClick="return showCalendar('endQtrDate', 'dd/MM/yyyy');" />
Unfortunately i cant see the code for the calendar after i click it. The only way i can see it is using the mozilla plugin "Firebug". I managed to get the div layer of which the calendar is displayed.
<div class="calendar"
style="position: absolute; display: none; left: 234px; top: 416px;">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<td colspan="1" class="button">-</td>
<td colspan="6" class="title" style="cursor: move;">October,
2004</td>
<td colspan="1" class="button">×</td>
</tr>
<tr class="headrow">
<td colspan="1" class="button">«</td>
<td colspan="1" class="button">‹</td>
<td colspan="4" class="button">Today</td>
<td colspan="1" class="button">›</td>
<td colspan="1" class="button">»</td>
</tr>
<tr class="daynames">
<td class="name wn">wk</td>
<td class="day name">Mon</td>
<td class="day name">Tue</td>
<td class="day name">Wed</td>
<td class="day name">Thu</td>
<td class="day name">Fri</td>
<td class="name day weekend">Sat</td>
<td class="name day weekend">Sun</td>
</tr>
</thead>
<tbody>
<tr class="daysrow">
<td class="day wn">40</td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day">1</td>
<td class="day weekend">2</td>
<td class="day weekend">3</td>
</tr>
<tr class="daysrow">
<td class="day wn">41</td>
<td class="day">4</td>
<td class="day">5</td>
<td class="day">6</td>
<td class="day">7</td>
<td class="day">8</td>
<td class="day weekend">9</td>
<td class="day weekend">10</td>
</tr>
<tr class="daysrow">
<td class="day wn">42</td>
<td class="day">11</td>
<td class="day">12</td>
<td class="day">13</td>
<td class="day">14</td>
<td class="selected day">15</td>
<td class="day weekend">16</td>
<td class="day weekend">17</td>
</tr>
<tr class="daysrow">
<td class="day wn">43</td>
<td class="day">18</td>
<td class="day">19</td>
<td class="day">20</td>
<td class="day">21</td>
<td class="day">22</td>
<td class="day weekend">23</td>
<td class="day weekend">24</td>
</tr>
<tr class="daysrow">
<td class="day wn">44</td>
<td class="day">25</td>
<td class="day">26</td>
<td class="day">27</td>
<td class="day">28</td>
<td class="day">29</td>
<td class="day weekend">30</td>
<td class="day weekend">31</td>
</tr>
<tr class="emptyrow">
<td class="day wn">36</td>
<td class="day">30</td>
<td class="day">31</td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
<td class="day"> </td>
</tr>
</tbody>
<tfoot>
<tr class="footrow">
<td colspan="8" class="ttip" style="cursor: move;">Select date</td>
</tr>
</tfoot>
</table>
<div class="combo" style="display: none;">
<div class="label">Jan</div>
<div class="label">Feb</div>
<div class="label">Mar</div>
<div class="label">Apr</div>
<div class="label">May</div>
<div class="label">Jun</div>
<div class="label">Jul</div>
<div class="label">Aug</div>
<div class="label">Sep</div>
<div class="label">Oct</div>
<div class="label">Nov</div>
<div class="label">Dec</div>
</div>
<div class="combo" style="display: none;">
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
<div class="label"></div>
</div>
</div>
If you look carefully you will see table cells for dates from 1 to 30th. How can i access these values using Selenium? I can use the IDE as it doesnt record anything when the calendar pops up.
The firebug has an option to display the xpath of any tag. I tried it on one of the td tags and it says this is the xpath.
/html/body/div/table/thead/tr[2]/td[3]
Can i use the above path to determine its value then click on it using selenium?
Thanks
To click on the image you can use click | calendarButton and that should load it up for you.
From there you will then need to click on items I would then use firebug to see the other items on the page.
Edit from extra info:
What you need to do then is use xpath=//td[#class="day" and text()="14"] for xpath or for css use css=td.day:contains('14')
The css route will be a lot quicker in browsers like Internet Explorer