Netsuite : HTML/Email Sublist of Transaction not looping correctly - html-email

I am looping the transaction.item to get the stockcodes which perfectly works like a charm.
But when I tried to get the links for individual item, it populates all of the td tag, the link should exist ONLY on stockcode 100132 but instead the rest of the items get the links too. Also I did double check the databse if there were any links for the rest of stockcodes. It only exist on stockcode 100132.
This is definitely weird and doesnt make any sense to me. Here's my code for the list
<#list transaction.item as sdsitem>
<tr style="text-align: center">
<td class="th-border stockcode">${sdsitem.item}</td>
<td class="th-border sdslink">
<#if (sdsitem.item.custitemabco_sds_email_link)??>
<a href="${sdsitem.item.custitemabco_sds_email_link}"
target="_blank">Link only exists on stockcode 100132</a>
</#if>
</td>
</tr>
</#list>
Thank you so much for those who will give a time to help me. I'm a beginner at Netsuite, and will really appreciate the answer. God bless!

I think the problem you're seeing can be answered by Suite Answer 98056. When an item is referenced on a transaction (Purchase/Sales/Work/Transfer Order etc), the fields that are found on the item record can not be directly accessed by using a dot to drill through the item.
Instead, you will need to create a new Transaction Item Field that is sourced from the item record, and the field name you're looking at using i.e. custitemabco_sds_email_link.

Related

Katalon IDE generated script gives error in eclipse

script2
I am using Katalon IDE for generating a script.
As my application has a signout button on top right, when I click it, IDE will generate
xpath=(.//*[normalize-space(text()) and normalize-space(.)='S'])[3]/following::span[3]
When running this in Eclipse this line gives an error. On inspecting this element I found this:
<td id="titlebar_hyperlink_8-co_0" role="presentation"
nowrap="nowrap" align="left" class=" verticalSpacer"
style="vertical-align:top;">
<span id="titlebar_hyperlink_8-lbsignout" align="left"
ctype="label" tabindex="0" targetid=
"titlebar_hyperlink_8-lbsignout" mxevent="click" accesskey="S"
class="text powerwhite anchor" style="display:block;cursor:pointer;"
title="Sign Out ALT+S" hotkey="83"><img id="titlebar_hyperlink_8-
lbsignout_image" src="btn_signout.gif" class="pwimg" border="0"
style="vertical-align:top;margin:0px;margin-left:3px;margin-right:3px;"
alt="Sign Out ALT+S"><span><span></span><span class="text hl
hlak">S</span><span>ign Out</span></span></span></td>
I'm new to selenium and all its related stuff. I would appreciate any kind of help on this. Thanks, Stack Overflow Community.
inspecting Signout element
Try changing the xpath to
'.//*[#title="Sign Out ALT+S"]'
Explanation:
You want to uniquely locate an element. Usually, you would try with the id, but the id of your element seems dynamic so it might not work in every case.
* - this means any element, and inside of the brackets [ ] you put the attribute you want to find the element by. I chose title because it will probably be unique on a given page.
I recommend this cheatsheet for xpath reference.

Selenium IDE target of subsequent cell in table based on first cells content

Basically, in English I want to tell Selenium "look for the content ttc202 in column one, of a multi-row, multicolumn table, then mouseOver on the Edit link"
HTML is as follows:
<tr id="86" class="ui-widget-content jqgrow ui-row-ltr ui-state-highlight" tabindex="0" role="row" aria-selected="true">
<td aria-describedby="jqLst_Short Name" style="text-align:left;" role="gridcell">
ttc202
</td>
<td aria-describedby="jqLst_Long Name" style="text-align:left;" role="gridcell">
Testing Training Company 202
</td>
<td aria-describedby="jqLst_Actions" title="" style="text-align:center;" role="gridcell">
<a class="act avw" title="View this Organisation" href="company/view?lcId=86"></a>
<a class="act aed" title="Edit this Organisation" href="company/edit?lcId=86"></a>
</td>
</tr>
I have tried this:
//td[contains(text(),'ttc202')]/following-sibling::td[contains(a/title(),'Edit this Organisation')]/a
All help appreciated. I assume I am missing something to skip over the first column, but can't imagine what will enable me to do that...
Progress:
I have found the following as an alternative which should get to the correct cell, but I am not able to workout how to target the title in the link code:
//td[normalize-space() ="ttc202"])[1]/following-sibling::td[2]/a[. = 'Edit']
I think this is progress just not sufficient to get me to the finish line!
After much investigation I found the following answer, perhaps this might help others who come across this question:
//tr[contains(td[1], "ttc202")]/td[3]/a[#title='Edit this Organisation']
The trick was realising which cell the information was in (represented by the square brackets).

Selenium-Webdriver JAVA:- i am getting error ""org.openqa.selenium.NoSuchElementException: no such element""" but Appointment Icon is present

I want to verify the tool tip but getting error no such element. I have confirmed that element is exist.
Java Code:
String toolTipTextAppointment = driver
.findElement(By
.id("//*[#id='EditView_NOTE_POPUP']/table/tbody/tr[2]/td/table/tbody/tr[3]/td[2]/table/tbody/tr/td[1]/a/img")).getAttribute("title");
System.out.println(toolTipTextAppointment);
HTML Code:
<td nowrap="nowrap" style="border:0px;">
<a class="" href="javascript:void(0);" onclick="showPopupActivity('Meetings','activityPopupFormAraContent',440,600);">
<img style="border: 6px none;" title="Appointment" src="themes/AutoAccelerator/images/calender_icon.gif"/>
</a>
</td>
Try
driver.findElement(By.cssSelector("img[src*='calender_icon.gif']")).getAttribute("title")
you have used findElement(By.id("")) but you passed xpath in it that is why it is not working
String toolTipTextAppointment = driver.findElement(By.xpath("/html/body/table/tbody/tr/td/a/img")).getAttribute("title");
System.out.println(toolTipTextAppointment);
The problem is visibility. There are two different concepts, existence and visibility (reachable to click or see).
You need to check if the element is visible, not sure about the syntax as I use the clojure library (clj-webdriver) but as far as I know should be shomething like this
e=driver.findElement(By.id("idOfElement")).isDisplayed();
Take into account that the driver will find hidden element but they are not visible. In this particular case you may need to scroll down the page to make the element visible, I suggest retrieve its e.location and use the coordinates with a javascript snippet
((JavascriptExecutor)driver).executeScript("window.scrollTo(" + e.location + ")");
Then the element will be visible and you will be able to interact with it, I usually have this code embedded in a helper function as it's a quite common issue.
Disclaimer: code is just an orientation, I don't know the syntax as I don't use Java. Hope it helps

Scrapy - Optional hxs.select

So, my issue is that, when I'm extracting data, there are a couple of entries on the page that, because there isn't a link also associated with them, they don't get selected:
To better explain here is the hxs.select statement that gets almost all of the data:
opening = hxs.select('//div[#id="body"]/div/table/tr/td/table/tr[2]/td/table[2]/tr/td[7]/font/a/text()').extract()
This statement gets all but 3 opening movie dates. The three missing dates, as I mentioned, don't have a link associated with them and are actually found at:
hxs.select('//div[#id="body"]/div/table/tr/td/table/tr[2]/td/table[2]/tr/td[7]/font/text()').extract()
*Notice: there is no /a found at the end.
I would just add an additional statement to get these, but I need all of the information in order. I also have statements that get a movie title and grossing amount. I then take these statements and iterate through them to pair them up with where they belong- I can't do this if I add another statement to separately deal with them. Any suggestions?
::::Data:::::
Here is the url of the data I'm trying to get BoxOfficeMojo
A quick note: If you use Firebug to view the xpath, it adds tbody which doens't actually exist (it adds it in).
Here is what a normal opening date looks like:
<td bgcolor="#ffffff" align="right">
<font size="2">
6/11/2010
</font>
</td>
Here is what one of the 'problem' opening dates look like:
<td bgcolor="#f4f4ff" align="right">
<font size="2">11/20/1981</font>
</td>
Just select all text nodes within that <font/> element using the descendant-or-self-axis step //.
//div[#id="body"]/div/table/tr/td/table/tr[2]/td/table[2]/tr/td[7]/font//text()

xPath Groupings how?

OK So, I'm learning/using xpath for a basic application that's effectively ripping data off another website.
I need to gain the knowledge of each persons Country/Suburb/area.
In some instances you can get Australia/Victoria/Melbourne for instance.
Others may just be Australia/Melbourne.
Or even just Melbourne OR just Australia.
So I'm current able to view the below code and rip all of the information with the string xpath //table/tr/td/table/tr/td/font/a. This returns every entry, but what I really want is to group each lot separately.
I hope someone out there on planet earth knows what I just tried to explain... and can help...
Good day!
The source document contains data like this:
<tr>
<td>
<font face="arial" size="2">
<strong>Location:</strong>
Australia,
<a href='http://maps.google.com/maps?q=Australia%20Victoria'target="mapblast" style='text-decoration:none'>Victoria</a>,
<a href='http://maps.google.com/maps?q=Australia%20Melbourne%20Victoria'target="mapblast" style='text-decoration:none'>Melbourne</a>
</font>
</td>
</tr>
To find each person's record, the XPath query is //table/tr/td/table/tr/td/font, or you could use //td/font[strong = 'Location:']. This will return a collection containing 1 element for each person.
To find the a elements under a particular font you could use XPath a from the font. This can also be done by iterating the children collection of the element.