<td class="menubox22" colspan="2">
<table cellpadding=0 cellspacing=0 border=0 class="mybox1">
<tr>
<td id="tdMenuBar" class="mybox1">
<table id="tblMenuBar" border="0" cellspacing=0 cellpadding=0>
<tr id="mytr">
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu1,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
Alerts
</td>
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu2,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
Inventory
</td>
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu3,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
RTAM Exclusion
</td>
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onmouseout="this.className='menulevel1norm'" class="menulevel1norm" onclick="PopupWin('Left',divMenu4,this,'.menuitempopuprownormal','.menuitempopuprowhighlight','','.menuitempopupscroll');">
Sales Order
</td>
<div id="divMenu20110329014658433878" name="actiondiv" style="visibility:hidden;position:absolute;border:">
<DIV myonclick="window.parent.location.href='/smcfs/console/order.search';">
Sales Order Console
</DIV>
<DIV myonclick="window.parent.location.href='/smcfs/console/shipment.search';">
Outbound Shipment Console
</DIV>
</div>
I am trying to click on Sales Order Console which is in the table row. I tried to access with xpath://*[#id='divMenu4']/div[1], which will be visible once I click on the Sales Order link, but I cannot access it.
Given the div containing "Sales Order Console" becomes visible after you click on the "Sales Order" td element, these xpath locators should do the job.
For the "Sales Order" td element:
//td[contains(text(), 'Sales Order')]
For the "Sales Order Console" element:
//div[#name='actiondiv']/div[1]
Please try below Xpath:-
//td[#id='PanelTable'][4]
OR More specific
//td[#id='PanelTable' and contains(text(),'Sales Order')]
Please get back to me if still facing any issue :)
Related
I am using bootstrap with AngularJS and trying to ng-repeat out a table within the template I purchased and when over a certain amount is put into the orderInformation.items array I run into issues with how the print looks.
I want to be able to hit print and have a defined page heading and a defined page footer that will not change and should nest in the top and bottom of the print preview across all pages. The only content that will change is the items that AngularJS is doing an ng-repeat on.
How can this be done? I've been searching for days and days and nothing out there seems to work.
<div class="row">
<div class="col-md-12 card-box">
<table id="invoice-contents" style="width: 100%">
<thead>
<!-- This is where logo, company details, barcode go -->
</thead>
<tbody>
<table id="item-table" class="table m-t-30" style="border-bottom: 1px solid rgba(0,0,0,.1)">
<thead>
<!-- Invoice Item headers -->
</thead>
<tbody>
<tr ng-repeat="item in orderInformation.items">
<td style="text-align: center">{{$index + 1}}</td>
<td style="text-align: center">{{item.qty.ordered}}</td>
<td style="text-align: center">{{item.qty.shipped}}</td>
<td style="text-align: center">{{item.qty.backordered}}</td>
<td style="text-align: center">{{item.binLocation}}</td>
<td style="text-align: center">{{item.partNumber}} - {{item.description}}</td>
<td style="text-align: center">{{item.price.current * item.qty.shipped | number: 2}}</td>
<td style="text-align: right">{{item.price.extended * item.qty.shipped | number: 2}}</td>
</tr>
</tbody>
</table>
</tbody>
<tfoot>
<!-- Special order notes, totals, taxes, terms -->
</tfoot>
</table>
</div>
</div> <!-- end container -->
This doesn't work when I use the recommended CSS that I have found around:
thead { display: table-header-group; }
tbody { display: table-row-group; }
tfoot { display: table-footer-group; }
The documentation says a table can't have two thead so I know the problem lies there, but I can't find any other way to get a block to print top and bottom on all pages other than table-header-group.
A way round this through much trial and error was to product an onscreen display of a single invoice page with how ever many rows of data and then use display:none to hide a view that would only show during print with CSS #media print. I had to calculate how many rows would show on each page and use .splice() and nested ng-repeats to get it displaying properly.
I'm trying to make an accessible calendar plugin where you can write the date in the input by hand or select it from a table. I'm using WAI-ARIA and I think I'm following the instructions correctly but the Chrome Developer Tools Accessibility audit gives me an error seen below
Instructions:
https://www.w3.org/TR/wai-aria-1.1/#combobox
https://www.w3.org/TR/wai-aria-1.1/#grid
Example:
https://www.w3.org/TR/wai-aria-practices-1.1/examples/combobox/aria1.1pattern/grid-combo.html
Error:
https://i.stack.imgur.com/OIX1f.png
My code:
<div class="container">
<label for="comboboxtextbox">the label</label>
<div role="combobox" aria-expanded="true" aria-owns="comboboxgrid" aria-haspopup="grid">
<input role="textbox" aria-multiline="false" id="comboboxtextbox" type="text" aria-controls="comboboxgrid">
</div>
<table role="grid" id="comboboxgrid">
<tbody>
<tr>
<th>one</th>
<th>two</th>
<th>three</th>
</tr>
<tr>
<td role="gridcell">1</td>
<td role="gridcell">2</td>
<td role="gridcell">3</td>
</tr>
</tbody>
</table>
</div>
The error message is saying that anything with a role of combobox has required child elements but it can’t find them in your markup. There’s been some changes to the combobox role so if you’re working from an older example it’ll be out of date. Try removing the role attributes from both the div and the table, and see if that helps.
I am not able to automate dropdown function in my BMC project. Tried lots of options. This will help me a lot. Please help..
<div id="WIN_0_913111809" class="df arfid913111809 ardbnCustomer Char" arid="913111809" artype="Char" ardbn="Customer" arlbox="0,4,114,17" style="z-index:993;top:2px; left:12px; width:309px; height:21px;" arwindowid="0">
<label id="label913111809" class="label f9" for="x-arid_WIN_0_913111809" style="top: 4px; left: 0px; width: 114px; height: 17px;">Customer*</label>
<textarea id="arid_WIN_0_913111809" class="text sr " cols="20" maxlen="255" style="top:0px; left:119px; width:164px; height:21px;" armenu="COM:CPY:Company=Oper/Cust-Q_ForInteractionCust" mstyle="2" arautoc="2" arautocak="0" arautoctt="400" rows="1" title="" wrap="off"></textarea>
<a class="btn btn3d menu" href="javascript:" style="top:0px; left:288px; width:21px; height:21px;">
<img class="btnimg" src="../../../../resources/images/mt_sprites.gif" alt="Menu for Customer*" title="">
</a>
</div>
<div class="MenuTableContainer" style="top: 20px;">
<table class="MenuTable" style="width: 386px;" cellspacing="0" cellpadding="0">
<tbody class="MenuTableBody">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<td class="MenuEntryNameHover" nowrap="">AARADHANA</td>
<td class="MenuEntryNoSubHover" arvalue="AARADHANA"></td>
</tr>
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
<tr class="MenuTableRow">
</tbody>
</table>
My screen looks like
This is not a select tag and is not designed to be one. It's an additional drop down menu element structured with tr and td tags. So using the Select class will not work.
Sample high level structure of a select tag:
<select>
<option>first option</option>
<option>second option</option>
</select
To solve your problem, You could simply use this:
driver.findElement(By.xpath("//div[#ardbn='Customer']//textarea")).clear();
driver.findElement(By.xpath("//div[#ardbn='Customer']//textarea")).sendKeys("AARADHANA");
Keep in mind that the text you are entering should be present in the menu. Entering a value that is not present in the list would result in the menu popping up and no value stored in the field, thereby throwing errors when you click on save since this is a mandatory field.
However if you do want to open the menu and choose something from there, you would have to wait for the element to appear and use one of these:
If the click needs to be performed on the tr
driver.findElement(By.xpath("//table[#class='MenuTable']//tr[td[.='AARADHANA']]")).click();
If the click needs to be performed on the td
driver.findElement(By.xpath("//table[#class='MenuTable']//tr//td[.='AARADHANA']")).click();
Be careful with this though, because
1. There may be many elements with the class 'MenuTable' that are hidden and if they are higher up in the hierarchy the script will fail.
2. If the first issue is not present and the customer you're trying to select is not visible you will have to scroll until the element is found before performing a click.
Highly recommend using the sendKeys option. Please ensure that you include code snippets to indicate what you've tried. This seems to be an issue with understanding the structure of the element in question.
So I'm working on a project where I need to form a grid of text input fields, a la an excel spreadsheet to display values and allow them to be updated.
Using angular, the snippet of html that does this with a regular table structure is:
<table >
<tr>
<th></th>
<th ng-repeat="week in weeks">{{week['weekEndDate']}}</th>
</tr>
<tr ng-repeat="field in fields" id={{field['fieldID']}}>
<td>{{field['displayName']}}</td>
<td ng-repeat="week in weeks" id={{week['weekID']}}>
{{ week[field.name] }}
</td>
</tr>
</table>
Where I have a table: weeks (checking, saving, expense) and fields (fieldID, name). The fields.name column maps directly to the column names in the weeks table.
My thing is, I want these to be type fields with the same table structure.
I tried:
<table >
<tr>
<th></th>
<th ng-repeat="week in weeks">{{week['weekEndDate']}}</th>
</tr>
<tr ng-repeat="field in fields" id={{field['fieldID']}}>
<td>{{field['displayName']}}</td>
<td ng-repeat="week in weeks" id={{week['weekID']}}>
<input ng-model="{{ week[field.name] }}" placeholder="{{ week[field.name] }}">
</td>
</tr>
</table>
But that gave me the error of
Syntax Error: Token '{' invalid key at column 2 of the expression [{{ week[field.name] }}] starting at [{ week[field.name] }}].
And also, I have buttons that allow you to move forward and backwards by one week at a time, which basically does the same query with different date parameters -- and each time a button is hit, it spawns an additional column of input fields rather than 'replacing' the current one.
So I'm wondering what the proper syntax for this type of desired behavior could be, as it is not liking the way I have it set up.
As always, thanks in advance gals and guys.
I have a list of mails which I want to show in a grid (<table>). Some of these mails have attachments. For their corresponding rows, I would like to show an attachment icon in the attachment column. For rest, it should be empty.
JsFiddle: http://jsfiddle.net/6s4Z5/
My template is as follows:
<table id="resultTable">
<thead>
<tr>
<th ng-repeat="columnId in schema.columnOrder">
<img src="icon_attach.png" ng-if="columnId == 'hasAttachments'">
{{schema.columns[columnId].displayText}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in results.mails">
<td ng-repeat="columnId in schema.columnOrder">
<img src="icon_attach.png" ng-if="columnId == 'hasAttachments' && row.hasAttachments">
<span ng-if="columnId != 'hasAttachments'" >{{ row[columnId] }}</span>
</td>
</tr>
</tbody>
</table>
where schema.columnOrder is an array of columnIds to be shown in the table.
This template is working but is this the best way to implement this? Moreover, I have to add an extra <span> for ng-if statement. Can that also be removed?
You pretty much can change it to something like:
<span ng-if='your check'><img src=''/>{{row[columnId}}</span>
You could set (in the controller) the value of the column hasAttachments to be the image you want to display there.