[prev in list] [next in list] [prev in thread] [next in thread] 

List:       selenium-devel
Subject:    RE: [Selenium-devel] Selenium failure
From:       "Guillaume Boudreau" <bougu () touchtunes ! com>
Date:       2005-10-21 14:09:50
Message-ID: 20051021140715.5B4C515A0C () mail ! touchtunes ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Note: This should be on the user mailing list, not the devel. If you reply,
please do at selenium-users@lists.public.thoughtworks.org
 
storeAttribute is used to store the attribute value of a tag. I don't think
that's what you want to do. Maybe you want to use storeText...
The error is probably caused by the fact that you're not using the correct
syntax for storeAttribute, which is elementLocator@attributeName...
 
Exactly what part of the HTML code you pasted do you want to save in the
"banner1" variable ?
 
- Guillaume Boudreau


  _____  

From: selenium-devel-bounces@lists.public.thoughtworks.org
[mailto:selenium-devel-bounces@lists.public.thoughtworks.org] On Behalf Of
Terry Simpson
Sent: Friday, October 21, 2005 5:59 AM
To: selenium-devel@lists.public.thoughtworks.org
Subject: [Selenium-devel] Selenium failure



Hi. Hope someone can help. I am new to software testing and exploring the
features in Selenium 0.6.0.

 

I'm trying to store an attribute using Xpath as a locator but Selenium is
telling me there is a failure. 

 

Using the same locator with clickAndWait action works fine

 

The message in the log console is listed below

 

 

 

*                                Executing: |open |
http://uat.pandanet.coop/cooptravel | |

*                                Executing: |storeAttribute |
//div[@id='ThreeBanner2']/a[@href] | banner1 |

*                                Unexpected Exception: number -> 51,
description -> DOM-L3-XPath 0.0.3.0: Invalid expression, "Expression
expected. //div[@id='ThreeBanner2']/a[<--", message -> DOM-L3-XPath 0.0.3.0:
Invalid expression, "Expression expected.//div[@id='ThreeBanner2']/a[<--",
code -> 51, name -> XPathException

 

The HTML code concerned is listed below

 

<div id="ThreeBanner2" class="BannerAd"><a
href="http://www.holidayautos.co.uk/cgi-bin/liveweb.sh/QSearch.w?ctryref=GBR
&lang=EN&aff=xcooptraveldirect" name="Holiday Car Hire"><img
src="images/banners/carhire2wide.gif" width="230" height="60" alt="Holiday
Car Hire" /></a></div>

 

 

Many thanks

 

Terry


Co-operative IT is part of The Midcounties Co-operative 

West Midlands Co-operative Society (WMCS) and Oxford, Swindon and Gloucester
Co-operative Society (OSG) have merged to form The Midcounties Co-operative.

The information contained in this e-mail is confidential and is intended
solely for the named recipient(s) only. If you are not the named
recipient(s) you should not disseminate, distribute or copy this e-mail. If
you have received this email in error please notify us by telephone on (+44
) 0845 4585 650 immediately and delete the message and any copies from your
computer. The Midcounties Co-operative has taken every reasonable precaution
to ensure that any attachment to this e-mail has been checked for viruses.
However, we cannot accept liability for any damage sustained as a result of
any such software viruses and advise you to carry out your own virus check
before opening any attachment. Furthermore, we do not accept responsibility
for any change made to this message after it was sent by the sender.


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE>@font-face {
	font-family: Wingdings;
}
@font-face {
	font-family: Verdana;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline
}
PRE {
	FONT-SIZE: 10pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Courier New"
}
SPAN.EmailStyle17 {
	COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
	page: Section1
}
OL {
	MARGIN-BOTTOM: 0cm
}
UL {
	MARGIN-BOTTOM: 0cm
}
</STYLE>
</HEAD>
<BODY lang=EN-GB vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=541550614-21102005><FONT face=Arial 
color=#0000ff size=2>Note: This should be on the user mailing list, not the 
devel. If you reply, please do at <A 
href="mailto:selenium-users@lists.public.thoughtworks.org">selenium-users@lists.public.thoughtworks.org</A></FONT></SPAN></DIV>
 <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff 
size=2>storeAttribute is used to store the attribute value of a tag. I don't 
think that's what you want to do. Maybe you want to use 
storeText...</FONT></SPAN></DIV>
<DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff size=2>The 
error is probably caused by the fact that you're not using the correct syntax 
for storeAttribute, which is <A 
href="mailto:elementLocator@attributeName">elementLocator@attributeName</A>...</FONT></SPAN></DIV>
 <DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff 
size=2>Exactly what part of the HTML code you pasted do you want to save in the 
"banner1" variable ?</FONT></SPAN></DIV>
<DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=541550614-21102005><FONT face=Arial color=#0000ff size=2>- 
Guillaume Boudreau</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff 
size=2></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
selenium-devel-bounces@lists.public.thoughtworks.org 
[mailto:selenium-devel-bounces@lists.public.thoughtworks.org] <B>On Behalf Of 
</B>Terry Simpson<BR><B>Sent:</B> Friday, October 21, 2005 5:59 AM<BR><B>To:</B> 
selenium-devel@lists.public.thoughtworks.org<BR><B>Subject:</B> [Selenium-devel] 
Selenium failure<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi. Hope someone can help. I am new 
to software testing and exploring the features in Selenium 
0.6.0.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I&#8217;m trying to store an attribute 
using Xpath as a locator but Selenium is telling me there is a failure. 
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Using the same locator with 
clickAndWait action works fine<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The message in the log console is 
listed below<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<DIV 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #cccccc 1pt solid; \
PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; MARGIN-LEFT: -16.5pt; BORDER-LEFT: medium \
none; MARGIN-RIGHT: 1.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-element: \
para-border-div"> <P class=MsoNormal 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; \
PADDING-LEFT: 0cm; MARGIN-BOTTOM: 1.5pt; PADDING-BOTTOM: 0cm; MARGIN-LEFT: 18pt; \
BORDER-LEFT: medium none; TEXT-INDENT: -18pt; MARGIN-RIGHT: 0cm; PADDING-TOP: 0cm; \
BORDER-BOTTOM: medium none; mso-margin-top-alt: 1.5pt; mso-list: l0 level1 \
lfo1"><![if !supportLists]><FONT  face=Symbol size=2><SPAN style="FONT-SIZE: 10pt; \
FONT-FAMILY: Symbol"><SPAN  style="mso-list: Ignore">&middot;<FONT face="Times New \
Roman" size=1><SPAN  style="FONT: 7pt 'Times New \
Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 </SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Verdana size=1><SPAN 
style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">Executing: |open | 
http://uat.pandanet.coop/cooptravel | |<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; \
PADDING-LEFT: 0cm; MARGIN-BOTTOM: 1.5pt; PADDING-BOTTOM: 0cm; MARGIN-LEFT: 18pt; \
BORDER-LEFT: medium none; TEXT-INDENT: -18pt; MARGIN-RIGHT: 0cm; PADDING-TOP: 0cm; \
BORDER-BOTTOM: medium none; mso-margin-top-alt: 1.5pt; mso-list: l0 level1 \
lfo1"><![if !supportLists]><FONT  face=Symbol size=2><SPAN style="FONT-SIZE: 10pt; \
FONT-FAMILY: Symbol"><SPAN  style="mso-list: Ignore">&middot;<FONT face="Times New \
Roman" size=1><SPAN  style="FONT: 7pt 'Times New \
Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 </SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Verdana size=1><SPAN 
style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">Executing: |storeAttribute | 
//div[@id='ThreeBanner2']/a[@href] | banner1 |<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; \
PADDING-LEFT: 0cm; MARGIN-BOTTOM: 1.5pt; PADDING-BOTTOM: 0cm; MARGIN-LEFT: 18pt; \
BORDER-LEFT: medium none; TEXT-INDENT: -18pt; MARGIN-RIGHT: 0cm; PADDING-TOP: 0cm; \
BORDER-BOTTOM: medium none; mso-margin-top-alt: 1.5pt; mso-list: l0 level1 \
lfo1"><![if !supportLists]><FONT  face=Symbol color=red size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Symbol"><SPAN 
style="mso-list: Ignore">&middot;<FONT face="Times New Roman" size=1><SPAN 
style="FONT: 7pt 'Times New \
Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 </SPAN></FONT></SPAN></SPAN></FONT><![endif]><B><FONT face=Verdana color=red 
size=1><SPAN 
style="FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: \
                Verdana">Unexpected 
Exception: number -&gt; 51, description -&gt; DOM-L3-XPath 0.0.3.0: Invalid 
expression, "Expression expected. //div[@id='ThreeBanner2']/a[&lt;--", message 
-&gt; DOM-L3-XPath 0.0.3.0: Invalid expression, "Expression 
expected.//div[@id='ThreeBanner2']/a[&lt;--", code -&gt; 51, name -&gt; 
XPathException<o:p></o:p></SPAN></FONT></B></P></DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal 
style="MARGIN-BOTTOM: 1.5pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 1.5pt; \
mso-margin-top-alt: 1.5pt"><FONT  face=Arial size=2><SPAN style="FONT-SIZE: 10pt; \
FONT-FAMILY: Arial">The HTML  code concerned is listed \
below<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal 
style="MARGIN-BOTTOM: 1.5pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 1.5pt; \
mso-margin-top-alt: 1.5pt"><FONT  face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: \
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P><PRE><FONT face="Courier New" size=2><SPAN \
style="FONT-SIZE: 10pt">&lt;<SPAN class=start-tag>div</SPAN><SPAN \
class=attribute-name> id</SPAN>=<SPAN class=attribute-value>"ThreeBanner2" \
</SPAN><SPAN class=attribute-name>class</SPAN>=<SPAN \
class=attribute-value>"BannerAd"</SPAN>&gt;&lt;<SPAN class=start-tag>a</SPAN><SPAN \
class=attribute-name> href</SPAN>=<SPAN \
class=attribute-value>"http://www.holidayautos.co.uk/cgi-bin/liveweb.sh/QSearch.w?ctryref=GBR&amp;lang=EN&amp;aff=xcooptraveldirect" \
</SPAN><SPAN class=attribute-name>name</SPAN>=<SPAN class=attribute-value>"Holiday \
Car Hire"</SPAN>&gt;&lt;<SPAN class=start-tag>img</SPAN><SPAN class=attribute-name> \
src</SPAN>=<SPAN class=attribute-value>"images/banners/carhire2wide.gif" </SPAN><SPAN \
class=attribute-name>width</SPAN>=<SPAN class=attribute-value>"230" </SPAN><SPAN \
class=attribute-name>height</SPAN>=<SPAN class=attribute-value>"60" </SPAN><SPAN \
class=attribute-name>alt</SPAN>=<SPAN class=attribute-value>"Holiday Car Hire" \
</SPAN><SPAN class=attribute-name>/</SPAN>&gt;&lt;/<SPAN \
class=end-tag>a</SPAN>&gt;&lt;/<SPAN \
class=end-tag>div</SPAN>&gt;<o:p></o:p></SPAN></FONT></PRE> <P class=MsoNormal><FONT \
face=Arial size=2><SPAN  style="FONT-SIZE: 10pt; FONT-FAMILY: \
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial \
size=2><SPAN  style="FONT-SIZE: 10pt; FONT-FAMILY: \
Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial \
size=2><SPAN  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Many 
thanks<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: \
Arial">Terry<o:p></o:p></SPAN></FONT></P></DIV><BR>Co-operative  IT is part of The \
Midcounties Co-operative <BR><BR>West Midlands Co-operative  Society (WMCS) and \
Oxford, Swindon and Gloucester Co-operative Society (OSG)  have merged to form The \
Midcounties Co-operative.<BR><BR>The information  contained in this e-mail is \
confidential and is intended solely for the named  recipient(s) only. If you are not \
the named recipient(s) you should not  disseminate, distribute or copy this e-mail. \
If you have received this email in  error please notify us by telephone on (+44 ) \
0845 4585 650 immediately and  delete the message and any copies from your computer. \
The Midcounties  Co-operative has taken every reasonable precaution to ensure that \
any attachment  to this e-mail has been checked for viruses. However, we cannot \
accept liability  for any damage sustained as a result of any such software viruses \
and advise you  to carry out your own virus check before opening any attachment. \
Furthermore, we  do not accept responsibility for any change made to this message \
after it was  sent by the sender.<BR></BODY></HTML>



_______________________________________________
Selenium-devel mailing list
Selenium-devel@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic