Help me! My code xml file in field ngày giao:
<td t-att-rowspan="len(layout_category['lines'])">
<span t-field="doc.date_order"/>
</td>
I want to combine it into one row, But I'm having the same problem Plese!! help me!
Unedited Image
I believe you are thinking of colspan rather than rowspan.
Try it with t-att-colspan instead.
Related
I would like to return the value found after "icon-rank-"
Also to be able to check, as in td1, if icon-rank exists.
<Table>
...
<td _ngcontent-sdm-c270="" class="material-suitability-icon p "></td>
<td _ngcontent-sdm-c270="" class="material-suitability-icon p icon-rank-1"></td>
<td _ngcontent-sdm-c270="" class="material-suitability-icon s icon-rank-2"></td>
....
<Table>
Current code
Set iconrank = ch.FindElement(FindBy.XPath("//td[contains(.,'icon-rank')]"))
Generates 'NoSuchElementError'. The element exists but not in the way I am attempting to find it.
Any help, even verbal concepts of how to do that would be appreciated. Any code offered is a bonus for me. I'm working in VBA but any language will help.
Thanks for your time.
I am trying to get items and price values
Website: https://www.rahulshettyacademy.com/seleniumPractise/#/
<div class="cart-info">
<table>
<tbody>
<tr>
<td>Items</td>
<td>:</td>
<td><strong>0</strong>
</td>
</tr><tr>
<td>Price</td>
<td>:</td>
<td><strong>0</strong>
</td>
What I have tried:
.//*[#class='cart-info']//td/..//strong
Problem:
The locator above shows 2 of 2. Even when I try .//*[#class='cart-info']//td/..//strong[1] ,I still get 2 of 2. What can I change in my xpath so that I can locate that Item and Price individually ? Thanks in advance for your time.
You can use this for items value:
//div[#class='cart-info']/table/tbody/tr[1]/td[3]/strong
and this for price value:
//div[#class='cart-info']/table/tbody/tr[2]/td[3]/strong
Try the below.
(.//*[#class='cart-info']//td/..//strong)[1]
To complete, another short options :
//tr[td[.="Items"]]//strong
//tr[td[.="Price"]]//strong
This question might be easy for some people.
I want to click on a link based on href value and text in link.Below is what i am using to search for text in link.
var elementselected = this.coinDataTable.element(by.css('a[href*='+CoinLink+']'));
I tried below code but it is not working. Can someone please suggest correct usage?
var elementselected = this.coinDataTable.element(by.css('a[href*="'+CoinLink+'"][text='CoinText'));
OR
var elementselected = this.coinDataTable.element(by.css('a[href*='+CoinLink+']')).element(by.linkText('CoinText'));
or
var elementselected = this.coinDataTable.element(by.linkText('CoinText')).element(by.css('a[href*='+CoinLink+']'));
This link is inside a table. Below is HTML for whole row. There are 2 links in this row. I want to select 2nd one which has CoinText in it.
<tr>
<td><img border="0" src="../../../images/pc_cdlibrary_side_icon_img_lighterbg.gif"></td>
<td>1C</td>
<td>MS</td>
<td>CoinText</td>
<td>$15</td>
<td>S-12 </td>
<td>B-21</td>
</tr>
You could use the by.cssContainingText to find the element by text and attribute:
by.cssContainingText('[href*="CoinLink"]', 'CoinText')
This code helps me to solve the issue
element(by.css('a[href*="CoinLink"]')).getText()).toContain('CoinLink')
I want to find "Native Starter Pro With Backend" text using XPath. The HTML code looks like this:
<tr>
<td style="text-align:left;vertical-align:middle;border:1px
solid #eee;word-wrap:break-word">
Native Starter Pro With Backend
<br/>
<small>type: Single License</small>
</td>
<td style="text-align:left;vertical-align:middle;border:1px
solid #eee">1</td>
I'm trying to select product name text. I tried this: //tbody/tr/td[1][contains(text(),'Pro With Backend')] but nothing has worked yet.
Have you tried something simple like this?
//td[contains(text(),'Pro With Backend')]
You probably don't need the predecessor tags and I'm not sure why you specified the [1] element when you are looking for some text.
I have tried your HTML code for finding XPath
Use this, it works for me
//td[contains(.,'Pro With Backend')]
I'm using Struts2 iterator to setup a list of checkbox in a table. I want to have 10 checkbox per row, so I'm doing the following:
<table>
<tr>
<s:iterator value="securityMasterFields" status="fieldNameStatus" var="fieldName">
<s:if test="#fieldNameStatus.index % 10 ==0">
</tr><tr>
</s:if>
<td>
<s:checkbox name="fieldsToShow" fieldValue="%{fieldName}" value="%{fieldName}"/>
</td>
</s:iterator>
</tr>
</table>
It never goes through the if, so I'm assuming the mod is not been calculated correctly. How do I do it?
thanks
Well, I had to add some parentheses and it worked correctly. The loop was working, it was just that it wasn't going through the if.
<s:if test="(#fieldNameStatus.index % 8 )==0"></tr><tr></s:if>
It looks good to me. Two thoughts:
1) try printing the result of the test in s:property tag
2) It looks like you will have empty table rows... Are you looking at the generated html or just the output, because if it is just the output then unless you have some CSS giving you some table padding and borders, without an empty 'td' element the row might collapse and make it appear as if nothing is being added. So do make sure you print the empty 'td' elements too!