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
Related
Trying to select and click multiple checkboxes on a page. they don't have a class, ID or names that match. All they have in common is their input type (checkbox). I'm able to select individual checkboxes using XPATH but its not practical as there's at least 100 checkboxes on the page.
Here's a section of the HTML. I've been testing this code on an off-line version of the site.
<body>
<tbody>
<tr>
<td class="borderBot"><b>Activity</b></td>
<td class="borderBot">
<table cellpadding="3" cellspacing="3" width="100%">
<tbody>
<tr>
<td width="33%">
<input type="checkbox" name="competency1Activity" value="1" />
Plan (ie Interpreted diag etc)
</td>
<td width="33%">
<input type="checkbox" name="competency1Activity" value="2" />
Carry Out (ie conducted work)
</td>
<td width="33%">
<input type="checkbox" name="competency1Activity" value="4" />
Complete (ie Compliance etc)
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="borderBot"><b>Supervision</b></td>
<td class="borderBot">
<table cellpadding="3" cellspacing="3" width="100%">
<tbody>
<tr>
<td width="33%">
<input
type="checkbox"
name="competency1Supervision"
value="1"
/>
Direct
</td>
<td width="33%">
<input
type="checkbox"
name="competency1Supervision"
value="2"
/>
General
</td>
<td width="33%">
<input
type="checkbox"
name="competency1Supervision"
value="4"
/>
Broad
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="borderBot"><b>Support</b></td>
<td class="borderBot">
<table cellpadding="3" cellspacing="3" width="100%">
<tbody>
<tr>
<td width="33%">
<input type="checkbox" name="competency1Support" value="1" />
Constant
</td>
<td width="33%">
<input type="checkbox" name="competency1Support" value="2" />
Intermittent
</td>
<td width="33%">
<input type="checkbox" name="competency1Support" value="4" />
Minimal
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="borderBot"><b>Materials</b></td>
<td class="borderBot">
<table cellpadding="3" cellspacing="3" width="100%">
<tbody>
<tr>
<td width="50%">
<input type="checkbox" name="competency1Extended" value="1" />
Insulation failure
</td>
<td width="50%">
<input type="checkbox" name="competency1Extended" value="2" />
Incorrect connections
</td>
</tr>
<tr>
<td width="50%">
<input type="checkbox" name="competency1Extended" value="4" />
Circuits-wiring; eg. open short
</td>
<td width="50%">
<input type="checkbox" name="competency1Extended" value="8" />
Unsafe condition
</td>
</tr>
<tr>
<td width="50%">
<input
type="checkbox"
name="competency1Extended"
value="16"
/>
Apparatus/component failure
</td>
<td width="50%">
<input
type="checkbox"
name="competency1Extended"
value="32"
/>
Related mechanical failure
</td>
</tr>
<tr>
<td width="50%">
<input
type="checkbox"
name="competency1Extended"
value="64"
/>
Read/interpret drawings/plans
</td>
<td width="50%">
<input
type="checkbox"
name="competency1Extended"
value="128"
/>
Other elec app and circuit faults
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<input
type="hidden"
id="competency1ExtendedCount"
name="competency1ExtendedCount"
value="8"
/>
</tbody>
</body>
Try 1 - this selects and clicks the first checkbox but none of the others
checkboxes = driver.find_element(By.CSS_SELECTOR, "input[type='checkbox']").click()
Try 2 - Thought this would work but I cant get the syntax right
checkboxes = driver.find_element(By.CSS_SELECTOR, "input[type='checkbox']")
for checkbox in checkboxes:
checkboxes.click()
time.sleep(.3)
Try 3 - able to select first checkbox (of 3) with this name
checkboxes = driver.find_element("name", "competency1Ativity").click()
find_element() will return only the first matching element, where as you need to identify all of them. So you need to use find_elements() method.
Solution
You can identify all the checkbox and store the elements within a list and then click on them one by one using either of the following locator strategies:
Using CSS_SELECTOR:
from selenium.webdriver.common.by import By
checkboxes = driver.find_elements(By.CSS_SELECTOR, "td input[type='checkbox']")
for checkbox in checkboxes:
checkbox.click()
Using XPATH:
from selenium.webdriver.common.by import By
checkboxes = driver.find_elements(By.XPATH, "//td//input[#type='checkbox']")
for checkbox in checkboxes:
checkbox.click()
Your option 2 was nearly correct, however it should have been find_elements() not find_element()
Since find_element() just returns an webelement where as find_elements() returns list of elements.
code:
checkboxes = driver.find_elements(By.CSS_SELECTOR, "input[type='checkbox']")
for checkbox in checkboxes:
checkbox.click()
time.sleep(0.5)
A bit new to this, so i would be needing some clarity. I want a scenario where I would click a button, it goes to the REST api, initiates a get request from the REST api and populate some fields.
here is a dummy REST api i created in Node.Js
https://financeplus.herokuapp.com/api/getaccounts/00343799710
When Called it gets this information
{
"error": false,
"data": {
"id": 0,
"fullname": "Lucas Tarella",
"address": "144 British Hush Ave",
"city": "Emory",
"state": "Georgia",
"tel": "+1(715)-232-7600",
"email": "lucas#blackorigins.com",
"nationalID": "AD87334322",
"gender": "Male",
"birth_date": "1989-05-10",
"ccy": "USD",
"bal": 950000,
"accNum": "00343799710",
"created_at": "2021-11-03T11:39:07.000Z",
"updated_at": "2021-11-04T06:38:38.000Z"
},
"message": "users List."
}
Now i want it to populate the page with this information, thereby replacing the mmmmm with the respective data such as fullname, city, telephone , address, balance on the react component which looks thus
import React, { useState } from 'react';
import { Link, useHistory } from 'react-router-dom';
const Balance = () => {
const[accNum, setAccNum] = useState('');
const[accDetails, setAccDetails] = useState('');
function getAccountBal(){
fetch('https://financeplus.herokuapp.com/api/getaccounts/'+accNum,{
method : 'GET',
mode : 'cors',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
}).then((response)=>response.json()).then((responseJson)=>{
setAccDetails(responseJson.data)
})
}
return (
<div align="center">
<table border="0" width="98%">
<tr>
<td> </td>
</tr>
<tr>
<td className="homeFormTable">
<table border="0" width="100%">
<tr>
<td>
<img border="0" src="images/FinancePlus_color_colorLogo.png" width="157" height="36" /></td>
<td width="136">
<p align="center" />
<li className="Logout"><Link to="/openaccount" className="ForLogout">Logout</Link></li>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<div className="upMenuTable">
<div className="nav-links">
<ul>
<li><Link to="/homepage">Home</Link></li>
<li><Link to="/openaccount">Account Opening</Link></li>
<li><Link to="/balance">Account Balance</Link></li>
<li><Link to="/transfers">Transfers</Link></li>
<li><Link to="/cashmgt">Deposit/Withdrawals</Link></li>
</ul>
</div>
</div>
<div className="SideNav">
<div className="sideNav-links">
<ul>
<li><Link to="/homepage">Home</Link></li>
<li><Link to="/openaccount">Account Opening</Link></li>
<li><Link to="/balance">Account Balance</Link></li>
<li><Link to="/transfers">Transfers</Link></li>
<li><Link to="/cashmgt">Deposit/Withdrawals</Link></li>
</ul>
</div>
</div>
<div className="playTable">
<table>
<div align="center">
<tr>
<td>
<p align="right" />
<font face="Arial Black" size="1">
Account Number:
</font>
<input type="text" name="T1" size="59" onChange ={(e) =>setAccNum(e.target.value)} className="searchBoxAcc" />
</td>
<td width="121">
<p align="right" />
<input onClick={getAccountBal} type="submit" value="Search" name="B1" className="searchBoxBtn" />
</td>
</tr>
</div>
<div align="center" className="infoArea">
<tr>
<td width="18%" align="right"><font face="Arial Black" size="1">
Full Name </font>
</td>
<td width="33%" align="left">
<font face="Arial Black" size="2"> mmmm</font>
</td>
<td width="1%"> </td>
<td width="21%" align="right"><font face="Arial Black" size="1">
Address </font></td>
<td width="24%" align="left" rowspan="2">
<font face="Arial Black" size="2"> mmmmm</font><p />
<font face="Arial Black" size="2"> </font>
</td>
</tr>
<tr>
<td width="18%" align="right"><font face="Arial Black" size="1">
City </font>
</td>
<td width="33%" align="left">
<font face="Arial Black" size="2"> mmmmm</font>
</td>
<td width="1%"> </td>
</tr>
<tr>
<td width="18%" align="right"><font face="Arial Black" size="1">
Telephone </font>
</td>
<td width="33%" align="left">
<font face="Arial Black" size="2"> mmmm</font>
</td>
<td width="1%"> </td>
<td width="21%" align="right"><font face="Arial Black" size="1">
Balance </font></td>
<td width="24%" align="left" rowspan="2">
<font face="Arial Black" size="2"> mmmmm</font><p />
<font face="Arial Black" size="2"> </font>
</td>
</tr>
</div>
</table>
</div>
<div className="Footer">
<table className="footerTable">
<p className="reserved"> © Finance Plus 2021</p>
</table>
</div>
</table>
</div>
);
}
export default Balance;
I am new to this, So I need Clarity of some sort.
When the request give you an answer you have the information in your accDetails variable. You just need to print it where you want using {}...
for example {accDetails.fullname}
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'));
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>
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.