How to get the text from this element? - node.js

I use selenium webdriver with node js.
I cannot get the text from this site. I need the "In progress" text.
I don't want to use absolute xpath, because I want use the code in other tests.
Thank you. :)
<div class="issuePanelContainer" id="issue_actions_container"
style="height: auto;">
<table cellpadding="0" cellspacing="0" border="0" width="100%"> .
</table>
<div class="issue-data-block">
<div class="actionContainer">
<div class="action-details">
<span class="aui-avatar aui-avatar-xsmall">
<span class="aui-avatar-inner">
<img alt="" src="https://jira.au.flitech.net/secure/useravatar?size=xsmall&ownerId=jan.plzak%40flightcentre.co.uk&avatarId=12582">
</span>
</span>
<a class="user-hover" rel="jan.plzak#flightcentre.co.uk" id="email_jan.plzak#flightcentre.co.uk" href="/secure/ViewProfile.jspa?name=jan.plzak%40flightcentre.co.uk">Jan Plzak</a>
made transition
- <span class="date" title="18/Jun/19 4:57 PM"><time class="livestamp" datetime="2019-06-18T16:57:08+1000">18/Jun/19 4:57 PM</time></span>
</div>
<div class="changehistory action-body">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody><tr>
<td width="60%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody><tr>
<td width="47%" align="right">
<span class=" jira-issue-status-lozenge aui-lozenge jira-issue-status-lozenge-blue-gray jira-issue-status-lozenge-new jira-issue-status-lozenge-max-width-medium" data-tooltip="<span class="jira-issue-status-tooltip-title">Open</span>" title="" original-title="">Open</span> </td>
<td align="center" nowrap="nowrap" width="6%">
<img src="/images/icons/arrow_right_small.gif" align="absmiddle" border="0" height="16" width="16">
</td>
<td width="47%">
<span class=" jira-issue-status-lozenge aui-lozenge jira-issue-status-lozenge-yellow jira-issue-status-lozenge-indeterminate jira-issue-status-lozenge-max-width-medium" data-tooltip="<span class="jira-issue-status-tooltip-title">In Progress</span><br><span class="jira-issue-status-tooltip-desc">The development task is currently in progress</span>" title="" original-title="">In Progress</span></td>
</tr>
</tbody></table>
</td>
<td width="20%">
13d 21h 18m
</td>
<td width="20%" align="center">
1
</td>
</tr>
</tbody></table>
</div>

List<WebElement> list=driver.findElement(By.xpath("//span[contains(#class,'status')]"));
for(WebElement li:list)
{
if(li.getText().equals("In progress")
{
li.click(); // or assert or whatever
}
}

This is my answer, which is working fine, and content free. :)
driver.findElements(By.xpath('//div[#class="changehistory action-body"]/table/tbody/tr/td/table/tbody/tr/td[1]/span'));

Related

How to get only rely content(black color) and not included quote(blue color) content using Selenium and Python

I want to know what to get some content not include quote content.
The following url is the target webpage:
https://forumd.hkgolden.com/view.aspx?type=BW&message=7219211
I must use a full xpath to get their content. I want to get black color content and I don't want to get blue content, but when I use the following code. I got blue and blank content together.
content = driver_blank.find_element_by_xpath('/html/body/form/div[5]/div/div/div[2]/div[1]/div[5]/table[8]/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div')
print(content.text)
The following is their html code:
<table width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 7px;">
<tbody>
<tr>
<td align="left">
<table class="repliers">
<tbody>
<tr hc7uwnfktbez9="" id="XoBTa" userid="461194" username="浅川梨奈">
<td class="repliers_left" style="background-color: #F3F2F1;">
<div>
<a name="275220714"></a>
<a href="javascript: ToggleUserDetail(6, 'XoBTa');" style="font-weight: bold; color: #FF0066;">
浅川梨奈
</a>
<br>
<br>
<div id="ThreadUser6" style="position: relative;">
<a href="/ProfilePage.aspx?userid=461194" style="text-decoration: none;">
<img src="/icons/97.gif" style="border-width: 0px;" alt="Logo">
</a>
<br>
<br>
<img src="/labels/4.gif" style="border-width: 0px;" alt="Member">
</div>
</div>
</td>
<td style="background-color: #F3F2F1; height: 100%; border: solid 1px #111111; vertical-align: top;">
<table class="repliers_right" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="vertical-align: top;">
<div class="ContentGrid">
<blockquote><div style="color: #0000A0;">有冇第隻款<img data-icons=":-[lm" src="/faces/lomore/angry.gif" alt=":-[lm"> <img data-icons=":-(lm" src="/faces/lomore/frown.gif" alt=":-(lm"> 我想要呢兩隻</div></blockquote>
<br>
係囉,反應好既會唔會考慮出其他?
<br>
我都想要其他
<img data-icons="^3^lm" src="/faces/lomore/kiss.gif" alt="^3^lm">
<img data-icons="[bomb]lm" src="/faces/lomore/bomb.gif" alt="[bomb]lm">
<br><br><br>
</div>
</td>
</tr>
<tr>
<td style="text-align: center; vertical-align: top;">
<div id="lineImage6" style="display: block; overflow: hidden;">
</div>
</td>
</tr>
<tr>
<td style="width: 100%; text-align: right;">
<div style="float: right; vertical-align: bottom; margin-top: 5px;">
<div id="lauming6" style="float: left; vertical-align: bottom;"></div>
<a class="btn btn_small btn_bookmark" href="Javascript:bookmarkThis(7219211)" id="laumingHref">留名</a>
<a class="btn btn_small btn_complain" href="contactus.aspx?messageid=7219211&replyid=275220714">投訴文章</a>
<a class="btn btn_small btn_quote" href="Javascript:QuoteReply(7219211,275220714);">快速引用</a>
<a class="btn btn_small btn_quote" href="post.aspx?mt=Y&rid=275220714&id=7219211&page=2">引用原文</a>
<span style="font-size: 12px; color:gray;">
15/4/2020 13:18
</span>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
I hope to use start-to, not, or contains instruction to finish it.
Can anyone help me? Thanks~~~

How to Scroll and Select/Doubleclick a listbox item?

I'm trying to get Intranet-web reports using VBA-Excel. How can I scroll to the item in a list and select or double-click it?
I located the item using ID of its parent-element and its own class and innertext values. I tried .click method in many ways, but without success.
Sub VBA_IE()
Dim IE As New SHDocVw.InternetExplorerMedium
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLDiv As MSHTML.IHTMLElement
Dim HTMLDivs As MSHTML.IHTMLElementCollection
'
'Here is IE object set and the page loaded
'
Set HTMLDoc = IE.document
Set HTMLDivs = HTMLDoc.getElementById "id_mstr104ListContainer").getElementsByTagName("div")
For Each HTMLDiv In HTMLDivs
If HTMLDiv.getAttribute("title") = "Fourth Center" Then
HTMLDiv.Focus
HTMLDiv.click
'wait-routines
Application.Wait Now + TimeValue("00:00:05")
Exit For
Else
End If
Next HTMLDiv
IE.Quit
Set IE = Nothing
End Sub
Part of page's source (extended on Feb 20 2019):
<div style="display: block;" class="mstrPromptQuestion" id="id_mstr80">
<span class="">
<div class="mstrPromptQuestionTitleBar">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="middle">
<span class="mstrPromptQuestionTitleBarIndex" style="display: inline;">1.</span>
<span class="mstrPromptQuestionTitleBarTitle">Delivery Source</span>
<span class="mstrPromptQuestionTitleBarRequired" title="(Required)">(Required)</span>
</td>
<td width="1%" align="right" valign="middle">
<img src="../images/1ptrans.gif" align="absmiddle" style="display: none" class="mstrPromptQuestionBackToTopImg" title="Back to top" onclick="mstr.behaviors.PromptQuestion.onClickBackToTop('id_mstr80')">
</td>
</tr>
</tbody>
</table>
</div>
<table cellspacing="0" cellpadding="0" class="mstrPromptQuestionInfoTable">
<tbody>
<tr>
<td class="mstrPromptQuestionInfoCellLeft">
<div class="mstrPromptQuestionMeaning" style="display: block;">Select items for Delivery Source</div>
<div class="mstrPromptQuestionInstructions" style="display: none;"></div>
<div class="mstrPromptQuestionMessage" style="display: none;"></div>
</td>
<td class="mstrPromptQuestionInfoCellRight">
<span class="mstrPlaceholder" name="saveAnswerView" id="id_mstr81"></span>
</td>
</tr>
</tbody>
</table>
<div class="mstrPromptQuestionContents">
<table cellspacing="0" cellpadding="0" class="mstrPromptQuestionSimpleAnswerViewTitle" style="display: none;">
<tbody>
<tr>
<td class="mstrPromptQuestionSimpleAnswerViewTitleCellRadio">
<input value="0" name="id_mstr80_radio" onmousedown="mstr.behaviors.PromptQuestion.onClickRadio('id_mstr80', false)" id="id_mstr80_radio_simpleAnswerView" type="radio" checked="true">
</td>
<td class="mstrPromptQuestionSimpleAnswerViewTitleCellText">
<label for="id_mstr80_radio_simpleAnswerView">Your selection:</label>
</td>
</tr>
</tbody>
</table>
<div style="padding-left: 0px;" class="mstrPromptQuestionSimpleAnswerView" onmousedown="this.previousSibling.rows[0].cells[0].childNodes[0].checked = true; mstr.behaviors.PromptQuestion.onClickRadio('id_mstr80', false)">
<table cellspacing="0" style="display: table;" cellpadding="0" class="mstrListCart" id="id_mstr84">
<colgroup><col class="mstrListCartLeftCol"><col class="mstrListCartButtonCol"><col class="mstrListCartRightCol"><col class="mstrListCartButtonCol"></colgroup>
<tbody>
<tr>
<td class="mstrListCartRowPathView" style="width:100%;" colspan="4">
<table cellspacing="0" cellpadding="0" class="mstrListCartTablePathView" style="display: none;">
<tbody>
<tr>
<td class="mstrListCartCellPathView">
<span class="mstrPlaceholder" name="pathView" id="id_mstr87"></span>
</td>
<td class="mstrListCartCellPathUpButton">
<span class="mstrPlaceholder" name="pathUpButton" id="id_mstr88"></span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="mstrListCartCellSearchView" style="width:100%;" colspan="4">
<div title="" class="mstrSearchField" id="id_mstr99" style="display: block;">
<table cellspacing="0" cellpadding="0" class="mstrSearchFieldTable">
<tbody>
<tr>
<td class="mstrSearchFieldSearchBox">
<div title="" class="mstrTextBoxWithIcon" id="id_mstr102" style="display: block;">
<div class="mstrTextBoxWithIconCaption">
<label for="id_mstr102_txt">Search for:</label>
</div>
<table cellspacing="0" cellpadding="0" class="mstrTextBoxWithIconTable">
<tbody>
<tr>
<td class="mstrTextBoxWithIconCellInput">
<div>
<input maxlength="" onclick="if (mstr.utils.ISW3C) {this.focus();}" onkeypress="return mstr.behaviors.TextBoxWithIcon.onkeypress(arguments[0], self, 'id_mstr102', this.value)" name="id_mstr102_txt" style="background-color: rgb(255, 255, 255);" id="id_mstr102_txt" size="" type="text">
</div>
</td>
<td class="mstrTextBoxWithIconCellIcon">
<div class="mstrToolButtonRoundedRight">
<input type="button" title="Search" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: left center; cursor: pointer;" class="mstrBGIcon_tbSearch" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" onclick="mstr.behaviors.TextBoxWithIcon.fire('id_mstr102', this.parentNode.parentNode.previousSibling.childNodes[0].childNodes[0].value);return false;">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td class="mstrSearchFieldMatchCaseBox">
<div class="mstrCheckBox" style="display: block;" id="id_mstr103">
<input type="checkbox" id="id_mstr103_input" onclick="mstr.$obj('id_mstr103').getModel() && mstr.$obj('id_mstr103').getModel().set('searchMatchCase', this.checked); mstr.$obj('id_mstr103').fireCommands(null, this.checked);">
<label title="" for="id_mstr103_input">Match case</label>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td class="mstrListCartCellAvailableView">
<table cellspacing="0" cellpadding="0" style="table-layout: auto; width: 100%;">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" title="" class="mstrListBlock" id="id_mstr104" style="display: table; width: 100%;">
<tbody>
<tr>
<td class="mstrListBlockCell">
<span class="">
<div class="mstrListBlockCaption" style="display: block;">Available:</div>
<div class="mstrListBlockHeader" style="display: none">
<span class="mstrPlaceholder" name="headerView" id="id_mstr105"></span>
</div>
<div style="width: auto; height: 150px;" class="mstrListBlockContents" id="ListBlockContents_id_mstr104">
<div oncontextmenu="return mstr.behaviors.Generic.oncontextmenu(arguments[0], self, 'id_mstr104');" onmouseup="try{mstr.$obj('id_mstr104').focus();}catch(localerr){}; return mstr.behaviors.Generic.clearBrowserHighlights(self)" onmousedown="var retVal = mstr.behaviors.ListView.onmousedown(arguments[0], self, 'id_mstr104'); try{mstr.$obj('id_mstr104').focus();}catch(localerr){}; return retVal" ondblclick="return mstr.behaviors.ListView.ondblclick(arguments[0], self, 'id_mstr104')" class="mstrListBlockListContainer" id="id_mstr104ListContainer" style="display: block; height: 80px;">
<div class="mstrListBlockItemSelected" title="First Center">
<div class="mstrBGIcon_ae mstrListBlockItemName" style="background-position: 2px 50%; padding-left: 23px;">First</div>
</div>
<div class="mstrListBlockItem" title="Second Center">
<div class="mstrBGIcon_ae mstrListBlockItemName" style="background-position: 2px 50%; padding-left: 23px;">Second Center</div>
</div>
<div class="mstrListBlockItem" title="Third Added Center">
<div class="mstrBGIcon_ae mstrListBlockItemName" style="background-position: 2px 50%; padding-left: 23px;">Third Added Center</div>
</div>
<div class="mstrListBlockItem" title="Fourth Center">
<div class="mstrBGIcon_ae mstrListBlockItemName" style="background-position: 2px 50%; padding-left: 23px;">Fourth Center</div>
</div>
</div>
<div class="mstrListBlockReadyState" style="display: none;"></div>
<div class="mstrListBlockMessageSection" style="display: none;">
<div class="mstrListBlockMessage"></div>
</div>
</div>
<a title="" href="#" onkeydown="return mstr.$obj('id_mstr104').onkeydown(arguments[0], self);" onkeypress="return mstr.$obj('id_mstr104').onkeypress(arguments[0], self);" class="mstrListBlockTabStop" id="id_mstr104TabStop">
<div></div>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</td>
<td class="mstrListCartCellAddRemoveButtons">
<div>
<div class="mstrToolButtonRounded" id="id_mstr106" style="display: block;">
<img title="Add" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: left center; cursor: pointer;" class="mstrBGIcon_tbAdd" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" align="absmiddle" onclick="var v = mstr.$obj('id_mstr106'); return (v.get('enabled')) ? mstr.$obj('id_mstr106').fireCommands() : false;">
</div>
</div>
<div>
<div class="mstrToolButtonRounded" id="id_mstr107" style="display: block;">
<img title="Add All" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: left center; cursor: pointer;" class="mstrBGIcon_tbAddAll" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" align="absmiddle" onclick="var v = mstr.$obj('id_mstr107'); return (v.get('enabled')) ? mstr.$obj('id_mstr107').fireCommands() : false;">
</div>
</div>
<div style="height: 11px; width: 1px; overflow: hidden"></div>
<div>
<div class="mstrToolButtonRounded" id="id_mstr108" style="display: block; background-position: left center;">
<img title="Remove" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: right center; cursor: default;" class="mstrBGIcon_tbRemove" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" align="absmiddle" onclick="var v = mstr.$obj('id_mstr108'); return (v.get('enabled')) ? mstr.$obj('id_mstr108').fireCommands() : false;">
</div>
</div>
<div>
<div class="mstrToolButtonRounded" id="id_mstr109" style="display: block; background-position: left center;">
<img title="Remove All" onmouseout="mstr.behaviors.ToolButtonRounded.unhover(this.parentNode)" style="background-position: right center; cursor: default;" class="mstrBGIcon_tbRemoveAll" src="../images/1ptrans.gif" onmouseover="mstr.behaviors.ToolButtonRounded.hover(this.parentNode)" align="absmiddle" onclick="var v = mstr.$obj('id_mstr109'); return (v.get('enabled')) ? mstr.$obj('id_mstr109').fireCommands() : false;">
</div>
</div>
</td>
<td class="mstrListCartCellSelectedView">
<table cellspacing="0" cellpadding="0" style="table-layout: auto; width: 100%;">
<tbody>
<tr>
<td>
<table cellspacing="0" cellpadding="0" title="" class="mstrListBlock" id="id_mstr110" style="display: table; width: 100%;">
<tbody>
<tr>
<td class="mstrListBlockCell"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<span class="">
<div class="mstrListBlockCaption" style="display: block;">Selected:</div>
<div class="mstrListBlockHeader" style="display: none">
<span class="mstrPlaceholder" name="headerView" id="id_mstr111"></span>
</div>
<div style="width: auto; height: 150px;" class="mstrListBlockContents" id="ListBlockContents_id_mstr110">
<div oncontextmenu="return mstr.behaviors.Generic.oncontextmenu(arguments[0], self, 'id_mstr110');" onmouseup="try{mstr.$obj('id_mstr110').focus();}catch(localerr){}; return mstr.behaviors.Generic.clearBrowserHighlights(self)" onmousedown="var retVal = mstr.behaviors.ListView.onmousedown(arguments[0], self, 'id_mstr110'); try{mstr.$obj('id_mstr110').focus();}catch(localerr){}; return retVal" ondblclick="return mstr.behaviors.ListView.ondblclick(arguments[0], self, 'id_mstr110')" class="mstrListBlockListContainer" id="id_mstr110ListContainer" style="display: none; height: auto;"></div>
<div class="mstrListBlockReadyState" style="display: none;"></div>
<div class="mstrListBlockMessageSection" style="display: block;">
<div class="mstrListBlockMessage">(none)</div>
</div>
</div>
<a title="" href="#" onkeydown="return mstr.$obj('id_mstr110').onkeydown(arguments[0], self);" onkeypress="return mstr.$obj('id_mstr110').onkeypress(arguments[0], self);" class="mstrListBlockTabStop" id="id_mstr110TabStop">
<div></div>
</a>
</span>
</td>
<td class="mstrListCartCellUpDownButtons">
<span class="mstrPlaceholder" name="upButton" id="id_mstr96"></span>
<span class="mstrPlaceholder" name="downButton" id="id_mstr97"></span>
</td>
</tr>
<tr>
<td class="mstrListCartCellFetchView" colspan="4">
<table title="" cellspacing="0" style="display: table;" cellpadding="0" class="mstrFetchControl" id="id_mstr112">
<tbody>
<tr>
<td>
<img title="First page" src="../images/1ptrans.gif" align="absmiddle" onclick="mstr.behaviors.FetchControl.fireFetchCommand('id_mstr112', 'FetchFirst')" class="mstrBGIcon_fetchFirstDisabled " style="display: none;">
</td>
<td>
<img title="Previous Page" src="../images/1ptrans.gif" align="absmiddle" onclick="mstr.behaviors.FetchControl.fireFetchCommand('id_mstr112', 'FetchPrevious')" class="mstrBGIcon_fetchPreviousDisabled " style="display: none;">
</td>
<td class="mstrFetchControlCellText">
<div onmouseout="this.className = this.className.replace(/Hover/,'')" onmousedown="mstr.behaviors.FetchControl.on_mousedown('id_mstr112')" class="mstrFetchControlText" onmouseover="if (!this.disabled) this.className += 'Hover'">1 - 4 of 4</div>
</td>
<td>
<img title="Next page" src="../images/1ptrans.gif" align="absmiddle" onclick="mstr.behaviors.FetchControl.fireFetchCommand('id_mstr112', 'FetchNext')" class="mstrBGIcon_fetchNextDisabled " style="display: none;">
</td>
<td>
<img title="Last page" src="../images/1ptrans.gif" align="absmiddle" onclick="mstr.behaviors.FetchControl.fireFetchCommand('id_mstr112', 'FetchLast')" class="mstrBGIcon_fetchLastDisabled " style="display: none;">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<table cellspacing="0" cellpadding="0" class="mstrPromptQuestionComplexAnswerViewTitle" style="display: none;">
<tbody>
<tr>
<td class="mstrPromptQuestionComplexAnswerViewTitleCellRadio">
<input value="1" name="id_mstr80_radio" onmousedown="mstr.behaviors.PromptQuestion.onClickRadio('id_mstr80', true)" id="id_mstr80_radio_complexAnswerView" type="radio">
</td>
<td class="mstrPromptQuestionComplexAnswerViewTitleCellText">
<label for="id_mstr80_radio_complexAnswerView">The default selection is:</label>
</td>
</tr>
</tbody>
</table>
<div style="padding-left: 23px; display: none;" class="mstrPromptQuestionComplexAnswerView" onmousedown="this.previousSibling.rows[0].cells[0].childNodes[0].checked = true; mstr.behaviors.PromptQuestion.onClickRadio('id_mstr80', true)">
<div title="" class="mstrTextDiv" style="display: block;" id="id_mstr113">
<div class="mstrTextDivCaption"></div>
<div class="mstrTextDivValue"></div>
</div>
</div>
</div>
</span>
</div>
VBA-code just passes through the command line like nothing happened, or reports an error that the method is not applicable to the element.
Looks like you will need events to be fired but here are two things to try
ie.document.parentWindow.execScript "document.querySelector('[title^=Fourth]').setAttribute('class','mstrListBlockItemSelected');"
And
ie.document.querySelector("[title='Fourth Center']").FireEvent "ondblclick"

Find label name which doesn't contain input immediately from a table

I am having a table which contains multiple td/tr.
My problem is label which i want to get doesn't contains input immediately neither that label has any attributes property.
I want to get "Countries of Permanent Residence" and Dates which are in span but doesn't have any properties that span is in div that too doesn't contains any property.
I tried with
formElement[input[name="icims_gh_Permanent_Country_Residence"]]
But don't know how to get associate label.
Html looks like:
<div style="margin:0px">
<table style="width:100%" border="1" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td valign="top">
<div style="margin:0px">
<span style="font-family:arial,helvetica,sans-serif;font-size:12px"> Countries of Permanent Residence (list all) </span>
</div>
</td>
<td valign="top">
<div style="margin:0px">
<span style="font-family:arial,helvetica,sans-serif;font-size:12px"> Dates </span>
</div>
</td>
</tr>
<tr>
<td colspan="2" valign="top">
<div style="margin:0px">
<div>
<input type="hidden" name="icims_gh_Permanent_Country_Residence" value="1">
<a name="0.1_icims_ga_Permanent_Country_Residence"></a>
<div>
<table style="width:100%;border:0px">
<tbody>
<tr>
<td>
<table style="width:100%" border="1" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td valign="top">
<div style="margin:0px">
<span style="font-family:arial,helvetica,sans-serif;font-size:12px">
<input type="text" name="icims_0_permResidenceCountry"> </span>
</div>
</td>
<td valign="top">
<div style="margin:0px">
<span style="font-family:arial,helvetica,sans-serif;font-size:12px">
<input type="text" name="icims_0_permResidenceCountryDates"> </span>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>

How to send XML reponse to groovy script in SoapUI

Referring to this previous question:
How to access the attribute value of soap UI response XML
I need this script to be dynamic, be able each test run to send a different XML body to parse.
How can this be achieved?
Sample XML
</script>
<form onsubmit="submitAction();return false;" name="submitForm" method="post" action="auth_vbv_browser_authentication.xsl">
<input value="auth_vbv_browser_authentication.xsl" type="hidden" name="AA_CurrentPage"/>
<input value="false" type="hidden" name="TDS_DeviceAuthentication"/>
<input value="0" type="hidden" name="mobileCount"/>
<table width="390" height="400" cellspacing="0" cellpadding="1" bgcolor="#e8e8e8" align="center">
<tr>
<td valign="top">
<table width="100%" style="padding:20px;" height="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff">
<tr>
<td valign="top" height="1">
<img width="140" src="../580655198662148898/auth_issuer_logo_vbv.gif" height="47" border="0" align="left"/>
<img width="89" src="../580655198662148898/auth_vbv_lg.gif" height="51" border="0" align="right"/>
</td>
</tr>
<tr>
<td height="20"/>
</tr>
<tr>
<td height="1" colspan="3" align="right">
<font size="-2">
<span style="display:none" name="links">
<a onclick="return openDialog(2,1)" id="langLink_sec" href="#">???</a>
<a style="display:none" id="lang_link_sec">???</a>
 English
</span>
<noscript>
???
 English
</noscript>
</font>
</td>
</tr>
<tr>
<td valign="top" height="1">
<font class="auth_Heading_en">Enter Your Authentication Data</font>
</td>
</tr>
<tr>
<td height="1"/>
</tr>
<tr>
<td valign="top" height="1">
<font class="auth_TxtMain_en">Please enter your</font>
<font class="auth_TxtMain_en">Verified by VISA Password</font>
<font class="auth_TxtMain_en">in the field(s) below to verify your identity for this purchase. This information is not disclosed to the merchant.</font>
</td>
</tr>
<tr>
(part of it very long):
I need to get out from this the value of SSID (1710d5e8428fd9d53db2fe7cfb1c79a5af0ecce).
Tried:
def xml = context.response
def holder = new com.eviware.soapui.support.XmlHolder(xml)
//use the xpath to retrieve the desctiption.
def ParRes = holder.getNodeValues("//*:input/#value")
//logging the descriptions
def str = new StringBuilder();
ParRes.each{
if("$it" != "InitAuth" ){
str = "$it"
}
}
return str
It is easy to handle dynamic response and parse it if Script Assertion is used for the same request step where you get the response. Thus an additional groovy script step can be avoided.
All the changed required is to change 1st statement from
def xml = """
static xml content
"""
to
def xml = context.response
And rest of the solution pointed in your question remains same.
As you have not provided complete response so I took only the form tag:
<form onsubmit="submitAction();return false;" name="submitForm" method="post" action="auth_vbv_browser_authentication.xsl">
<input value="auth_vbv_browser_authentication.xsl" type="hidden" name="AA_CurrentPage"/>
<input value="false" type="hidden" name="TDS_DeviceAuthentication"/>
<input value="0" type="hidden" name="mobileCount"/>
<table width="390" height="400" cellspacing="0" cellpadding="1" bgcolor="#e8e8e8" align="center">
<tr>
<td valign="top">
<table width="100%" style="padding:20px;" height="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff">
<tr>
<td valign="top" height="1">
<img width="140" src="../580655198662148898/auth_issuer_logo_vbv.gif" height="47" border="0" align="left"/>
<img width="89" src="../580655198662148898/auth_vbv_lg.gif" height="51" border="0" align="right"/>
</td>
</tr>
<tr>
<td height="20"/>
</tr>
<tr>
<td height="1" colspan="3" align="right">
<font size="-2">
<span style="display:none" name="links">
<a onclick="return openDialog(2,1)" id="langLink_sec" href="#">???</a>
<a style="display:none" id="lang_link_sec">???</a>
English
</span>
<noscript>
???
English
</noscript>
</font>
</td>
</tr>
<tr>
<td valign="top" height="1">
<font class="auth_Heading_en">Enter Your Authentication Data</font>
</td>
</tr>
<tr>
<td height="1"/>
</tr>
<tr>
<td valign="top" height="1">
<font class="auth_TxtMain_en">Please enter your</font>
<font class="auth_TxtMain_en">Verified by VISA Password</font>
<font class="auth_TxtMain_en">in the field(s) below to verify your identity for this purchase. This information is not disclosed to the merchant.</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
As per my understanding you want the Value of SSID i.e1710d5e8428fd9d53db2fe7cfb1c79a5af0ecce
and you want to transfer this in next step,so why dont you use Property transfer step and provide Xpath as below:
substring-before(substring-after(/form[#onsubmit="submitAction();return false;"]/table[#width="390"]/tr/td[#valign="top"]/table[#width="100%"]/tr[3]/td[#height="1"]/font[#size="-2"]/noscript/a[#href="auth_vbv_browser_authentication.xsl?AA_CurrentPage=auth_vbv_browser_authentication.xsl&AA_Ignore_Pattern=true&AA_LANCODE=1&SSID=1710d5e8428fd9d53db2fe7cfb1c79a5af0ecce&popup=false"]/#href,"SSID="),"&")
result of this Xpath:1710d5e8428fd9d53db2fe7cfb1c79a5af0ecce
I have tested it on my SOAPUI and working fine.Hope this helps
Note: I have copied Xpath from Form tag,Please change the Xpath as per your requirement,you can use online tools to calulate Xpath or any XML editor.
For more info on Xpath :Check this out

why does the Gmail app on iPhone ignore media queries?

I'm putting together an email newsletter for a client, and find that more or less every email client and app provides a more or less readable experience (they still need some work) - except for the Gmail app. Once the breakpoint is reached, it should be displaying as one column. But it does not.
I'm not sure why this is. Is there a way to force the app to display the newsletter in desktop mode shrunken down to fit the screen width? Or is there a way to target Gmail with a conditional so that the content will obey the media query?
Related: the litmus tests I've ran don't look anything at all like the result I'm getting on my iPhone. Why is that?
http://codepen.io/sabaeus/pen/ZGQWdZ?editors=100
This is in my document head:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<title>Title</title>
</head>
And then this is in my body:
<body>
<!-- background table start -->
<table width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0" id="background_table">
<tbody>
<tr>
<td>
<!-- end of background table start -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="display:inline-block;" width="100%"><img src="http://placehold.it/197x41" style="display:block;"></td>
</tr>
<tr>
<td width="100%" height="20"> </td>
</tr>
<tr>
<td width="100%" height="100">
<img src="http://placehold.it/699x400" style="display:block;">
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- hello/quick links -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="393" class="column" style="height:100%;display:inline-block;margin-right:53px">Hello,
<br>
<br> Intro text
</td>
<td width="230" class="column" style="height:100%;padding:20px;">
<span class="h1">Quick Links</span>
<br>
<br>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>Link 1</strong></span>
<br> Info for link 1
<br>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>Link 2</strong></span>
<br>Link
<br>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>Link 3</strong></span>
<br>Link
</td>
</tr>
</tbody>
</table>
<!-- hello/quick links -->
<!-- marketing communications -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td>
<span class="h1">Headline 1</a>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="148" class="column-img" style="height:100%;display:inline-block;margin-right:17px">
<img src="http://placehold.it/148x111" style="display:block;">
</td>
<td width="503" class="column-text-1" style="padding:20px"><span style="font-size:18px;display:inline-block; padding-bottom:5px;"><strong>Sub head</strong></span>
<br>Info info info info info info info info info info info</td>
</tr>
</tbody>
</table>
<!-- marketing communications -->
<!-- new print collateral -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Headline 2</span>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="148" class="column-img" style="height:100%;display:inline-block;margin-right:17px"><img src="http://placehold.it/148x220" style="display:block;"></td>
<td width="503" class="column-text-1" style="padding:20px"><span style="font-size:18px;display:inline-block; padding-bottom:5px;"><strong>Sub head</strong></span>
<br> info info info info</td>
</tr>
</tbody>
</table>
<!-- new print collateral -->
<!-- advertising -->
<!-- brand ads -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1" style="display:inline-block;">Headline 3</span>
<br>
<span style="font-size:18px;">
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="padding-top:0px;">
<span style="font-size:18px;"><strong>Sub head</strong></span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="350" class="column" style="height:100%;margin-right:131px"><img src="http://placehold.it/246x264" style="min-width:350px; display:block;"></td>
<td style="height:100%;" width="350" class="column">
<img src="http://www.placehold.it/267x324" style="min-width:350px; display:block;"></td>
</tr>
</tbody>
</table>
<!-- brand ads -->
<!-- community ads -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="padding-top:30px;padding-bottom:0px;">
<span style="font-size:18px;"><strong>Sub head</strong></span>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="350" class="column" style="height:100%;margin-right:131px">
<img src="http://placehold.it/197x320" style="min-width:350px; display:block">
<table>
<tbody>
<tr>
<td>
info info info info
</td>
</tr>
</tbody>
</table>
</td>
<td style="height:100%;" width="350" class="column"><img src="http://placehold.it/212x328" style="min-width:350px;display:block">
<table>
<tbody>
<tr>
<td style="padding-top:10px">
<br> info info info info info
</td>
</tr>
</tbody>
</table>
</td>
</td>
</tr>
</tbody>
</table>
<!-- community ads -->
<!-- advertising -->
<!-- talent acquisition -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Headline 4</span>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<!-- <tr>
<td width="100%" height="10"> </td>
</tr>
-->
<tr>
<td width="100%" height="100">
<a href="#" target="_blank">
<img src="http://placehold.it/668x195" style="width:100%;display:block;"></a>
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- text -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
</tr>
<tr>
<td width="100%" height="100">
<span style="font-size:18px;display:inline-block; padding-bottom:5px;"><strong>Sub head</strong></span>
<br>Info info info
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- text -->
<!-- talent acquisition -->
<!-- new expert advice -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Headline 5</span>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td>
<span style="display:inline-block;">Info info info</span>
</td>
</tr>
</tbody>
</table>
<!-- 0 -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;margin-right:46px"><img src="http://placehold.it/345x281" style="width:100%;display:block;"></td>
<td width="322" class="column" style="padding:20px;">
<span style="display:inline-block; padding-bottom:5px;"><strong>info info</strong></span>
<br>info info info</td>
</tr>
</tbody>
</table>
<!-- 0 -->
<!-- 1 -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;margin-right:46px"><img src="http://placehold.it/345x281" style="width:100%;display:block;"></td>
<td width="322" class="column" style="padding:20px;">
<span style="display:inline-block; padding-bottom:5px;"><strong>info info</strong></span>
<br>info info info</td>
</tr>
</tbody>
</table>
<!-- 1 -->
<!-- 2 -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;margin-right:46px"><img src="http://placehold.it/345x281" style="width:100%;display:block;"></td>
<td width="322" class="column" style="padding:20px">
<span style="display:inline-block; padding-bottom:5px;"><strong>info info</strong><span>
<br>
info info info</td>
</tr>
</tbody>
</table>
<!-- 2 -->
<!-- 3 -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;margin-right:46px"><img src="http://placehold.it/345x281" style="width:100%;display:block;"></td>
<td width="322" class="column" style="padding:20px;">
<span style="display:inline-block; padding-bottom:5px;"><strong>info info</strong></span>
<br>info info info
</td>
</tr>
</tbody>
</table>
<!-- 3 -->
<!-- new expert advice -->
<!-- epic speaker videos -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Headline 6</span>
</td>
</tr>
</tbody>
</table>
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" style="height:100%;display:inline-block;margin-right:17px;" class="column"><img src="http://placehold.it/258x154" style="width:100%;display:block;"></td>
<td width="423" class="column" style="padding:20px;">info info info info info</td>
</tr>
</tbody>
</table>
<!-- epic speaker videos -->
<!-- upcoming events -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Headline 7</span>
</td>
</tr>
</tbody>
</table>
<table width="800" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<!-- <tr>
<td width="100%" height="10"> </td>
</tr>
-->
<tr>
<td width="100%" height="100">
<span style="font-size:17px"><strong>
May is: Physical Fitness Month / Jewish American Heritage Month</strong></span>
<table>
<tbody>
<tr>
<td>
<ul style="line-height: 150%; width: 582px;">
<li style="list-style-type:none; padding-left:10px;background-color:#ededed">May 10th - <span style="font-weight:300">Mother’s Day</span> </li>
<li style="list-style-type:none;padding-left:10px;">May 25th - <span style="font-weight:300">Memorial Day</span> </li>
<li style="list-style-type:none; padding-left:10px; background-color:#ededed">June 6th - <span style="font-weight:300">D-Day</span></li>
<li style="list-style-type:none;padding-left:10px;">June 14th - <span style="font-weight:300">Flag Day</span></li>
<li style="list-style-type:none; padding-left:10px; background-color:#ededed">June 21st - <span style="font-weight:300">Father’s Day</span></li>
<li style="list-style-type:none;padding-left:10px;">June 21st - <span style="font-weight:300">Alzheimer’s Association Longest day (click below for details)</span></li>
</ul>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- alzheimer's -->
<table width="699" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="10"> </td>
</tr>
<tr>
<td width="100%" height="100">
<img src="http://placehold.it/454x174" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- alzheimer's -->
<!-- prior -->
<table width="800" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="10"> </td>
</tr>
<tr>
<td width="100%" height="100" style="padding:20px;">
<span style="display:inline-block;padding-bottom:5px">
Info info info
</span>
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- prior-->
<!-- upcoming events -->
<!-- footer -->
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%">
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<!-- Spacing -->
<tr>
<td height="20" style="font-size:1px; line-height:1px; mso-line-height-rule: exactly;"> </td>
</tr>
<!-- Spacing -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!-- end of footer -->
<!-- end of background table-->
</td>
</tr>
</tbody>
</table>
</body>
</html>
CSS:
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700);
body {
width: 100% !important;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
margin: 0;
padding: 0;
}
#background_table {
margin: 0;
padding: 0;
width: 100%!important;
line-height: 100%!important;
}
img {
outline: none;
text-decoration: none;
border: none;
-ms-interpolation-mode: bicubic;
max-width: 100%;
height: auto;
display: block;
}
table td {
border-collapse: collapse;
vertical-align: middle;
font-family: 'Open Sans', Trebuchet, sans-serif;
font-size: 17px;
line-height:120%;
color: #000;
}
table td[class="column"] {
height: 100px;
width: 393px;
padding: 15px;
}
table {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
table[class="body_table"] {
width: 699px;
margin-top: 21px;
}
table span[class="h1"] {
font-weight:300;
font-size:35px;
color:#ff9001;
}
table td[class="top-buffer"] {
padding-top: 25px;
}
#media only screen and (max-width: 640px) {
table[class="body_table"] {
width: 600px!important;
}
table td[class="column"] {
width: 100%!important;
display: block!important;
}
table span[class="h1"] {
line-height:110%!important;
font-size:23px!important;
}
*[class="mob-hide"] { display: none !important }
}
Gmail app and Gmail web service strips all class and ID styling out of your style tags. More Info Here
There is an option for some elemental styling in Gmail web service as seen in link above, but other than that you need to do everything inline. This removes the capabilities of responsive design as you cannot inline media queries.
Your best bet is fluid design(percentage based to fit small or large screen) or a mobile first hybrid design that is essentially designed first for Gmail/Outlook and then uses media queries and style tags to make it work for all other email clients.

Resources