[Webtest] (no subject)

Lisa Crispin Lisa Crispin <lisa.crispin@gmail.com>
Mon, 11 Jul 2011 08:19:26 -0600


--0016364c7235e197cd04a7cbde50
Content-Type: text/plain; charset=ISO-8859-1

We've had similar problems in the past couple months and have not found a
solution, other than 'forcehiddeninputfield' and having to click hidden
radio buttons and the like to force the result we want. We can't get the JS
event to trigger. So I'm interested in the answer also.
-- Lisa

On Mon, Jul 11, 2011 at 7:50 AM, Sophie De Malet Roquefort <
sdemaletroquefort@datadiscoveries.com> wrote:

> **
>
> Hi there,
>
>    I am using an Ajax drop down extender control, which displays a grid
> when a text box is clicked.
>
>
> In the rowdatabound event of the grid, I set the onclick event handler to
> set the selected row of the grid.
>
>
>
> e.Row.Attributes[
> "onclick"] = Page.ClientScript.GetPostBackClientHyperlink(FileGridView,
>
> "Select$" + e.Row.RowIndex);
>
>
>
> This is then handled by the following event handler:
>
>
>
> protected void FileGridView_SelectedIndexChanged(object sender, EventArgse)
>
> {
>
>      txtFile.Text = FileGridView.SelectedRow !=
> null ? Server.HtmlDecode(FileGridView.SelectedRow.Cells[1].Text) : "";
>
>      ProfileCommon profile = Profile.GetProfile(Profile.UserName);
>
>      if (FileGridView.SelectedRow == null) return;
>
>      profile.
> User.ImportId = Convert.ToInt32(FileGridView.SelectedRow.Cells[0].Text);
>
>      profile.
> Save();
>
>      Response.Redirect(
> "~/Overview.aspx");
>
> }
>
>
>
> The generated html from Firebug is :
>
>
>  <div>
>  <table id="ctl00_ctl00_loggedOnDropDown_importDropDown_FileGridView"
> class="FileGridViewClass" cellspacing="0" border="0" style=" border-
> color:Black;border-width:1px;border-style:Solid;border-collapse:collapse;"
> >
>  <tbody>
>  <tr style="color:White;background-color:#F24B31;">
>   <tr style="background-color:#DDDDDD;" onmouseout="
> this.style.backgroundColor='#EEEEEE'" onmouseover="
> this.style.backgroundColor='#999999'" onclick="
> javascript:__doPostBack('ctl00$ctl00$loggedOnDropDown$importDropDown$FileGridView','Select$0')
> " >
>  <td>
>   *<span id="
> ctl00_ctl00_loggedOnDropDown_importDropDown_FileGridView_ctl02_importName"
> >test 2</span>*
> </td>
>  <td>23.09.2008</td>
>  <td align="center">
>  <td>12.09.2009</td>
>  <td class="align-right">99</td>
> </tr>
> <tr style="background-color:#EEEEEE;" onmouseout="
> this.style.backgroundColor='#DDDDDD'" onmouseover="
> this.style.backgroundColor='#999999'" onclick="javascript:__doPostBack('ctl00$ctl00$loggedOnDropDown$importDropDown$FileGridView','Select$1')
> ">
> </tbody>
> </table>
> </div>
>
>
>
>
>
> To test this, I click on the grid row to try and trigger the onclick event.
>
>
>
>      <clickElement xpath="//span[contains(@id, '_importName') and
> contains(text(), 'test 2')]"/>
>
>
>
>
>
> I get no errors calling the clickelement, but the onclick event does not
> seem to be getting called.  No re-direct is occurring to reload the Overview
> page.
>
>
>
> Does anyone have any ideas why this might be happening.
>
>
>
> Kind regards
> Sophie
>
>
> Sophie De Malet Roquefort
> IT Department
> 0131 555 1100
>
> T: 0131 555 1100
> F: 0131 555 6300
> W: www.datadiscoveries.com
>  <http://www.datadiscoveries.com>
>
> [image: Data Discoveries Logo]
>
>
> Want to know more about data management? Download a whitepaper<http://www.datadiscoveries.com/forms/whitepaper/whitepaper_bank/>
>
> Do you work in the non-profit sector? Come to our free event.<http://www.datadiscoveries.com/industries/charities/best_practice_marketing_forum/>
>
>
> Please let me know if this e-mail address is not the best one to use.
>
> This e-mail is intended for the named addressee only. Its contents are
> private and confidential and should not be read, copied or disclosed to or
> by any other person. If you have received this transmission in error, please
> notify the sender immediately by e-mail or telephone (0131 555 1100), delete
> the contents of this transmission and destroy any copies made. Copyright
> Data Discoveries Limited. All rights reserved. No part of this communication
> may be reproduced without the prior written permission of Data Discoveries
> Limited.
>
> Opinions, conclusions and other information in this message that do not
> relate to the official business of Data Discoveries Limited shall be
> understood as neither given nor endorsed by it. Internet e-mails are not
> necessarily secure. Data Discoveries Limited does not accept responsibility
> for changes made to this message after it was sent or viruses transmitted
> through this e-mail or any attachment. You should carry out your own virus
> checking procedure before opening any attachment to this e-mail. The e-mail
> and IT systems of Data Discoveries Limited are subject to random monitoring
> and recording by or on behalf of Data Discoveries Limited.
> Thank you.
>
> Data Discoveries Limited: Registered in Scotland with Registered Number
> SC157375.
> Registered Office: 16/1 Timber Bush Edinburgh EH6 6QH. VAT Registration
> Number: GB 663 8176 09.
> Member of the Direct Marketing Association.
>
>
> _______________________________________________ WebTest mailing list
> WebTest@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest




-- 
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
Contributor to _Beautiful Testing_ (O'Reilly 2009)
http://lisacrispin.com
@lisacrispin on Twitter
http://entaggle.com/lisacrispin

--0016364c7235e197cd04a7cbde50
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

We&#39;ve had similar problems in the past couple months and have not found=
 a solution, other than &#39;forcehiddeninputfield&#39; and having to click=
 hidden radio buttons and the like to force the result we want. We can&#39;=
t get the JS event to trigger. So I&#39;m interested in the answer also.<br=
>
-- Lisa<br><br><div class=3D"gmail_quote">On Mon, Jul 11, 2011 at 7:50 AM, =
Sophie De Malet Roquefort <span dir=3D"ltr">&lt;<a href=3D"mailto:sdemaletr=
oquefort@datadiscoveries.com">sdemaletroquefort@datadiscoveries.com</a>&gt;=
</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><u></u>




<div><font size=3D"2">
<p align=3D"left"><font face=3D"Tahoma">Hi=A0there,<font face=3D"Tahoma"><f=
ont face=3D"Tahoma"></font></font></font></p>
<div><font face=3D"Tahoma"></font>=A0</div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma"></font></div>
<div><font face=3D"Tahoma">I am using an Ajax drop down extender control, w=
hich displays a grid when a text box is clicked.</font></div>
<div>=A0</div>
<div><font face=3D"Consolas"><font face=3D"Consolas">
<p>In the rowdatabound event of the grid, I set the onclick event handler t=
o set the selected row of the grid.</p>
<p>=A0</p>
<p>e.Row.Attributes[</p></font></font><font color=3D"#a31515" face=3D"Conso=
las"><font color=3D"#a31515" face=3D"Consolas"><font color=3D"#a31515" face=
=3D"Consolas">&quot;onclick&quot;</font></font></font><font face=3D"Consola=
s"><font face=3D"Consolas">] =3D Page.ClientScript.GetPostBackClientHyperli=
nk(FileGridView,
<p></p></font></font><font color=3D"#a31515" face=3D"Consolas"><font color=
=3D"#a31515" face=3D"Consolas"><font color=3D"#a31515" face=3D"Consolas">&q=
uot;Select$&quot;</font></font></font><font face=3D"Consolas"><font face=3D=
"Consolas"> + e.Row.RowIndex);</font></font>
<p><font face=3D"Consolas"><font face=3D"Consolas"></font></font>=A0</p>
<p><font face=3D"Consolas"><font face=3D"Consolas">This is then handled by =
the following event handler:</font></font></p>
<p><font face=3D"Consolas"></font>=A0</p><font face=3D"Consolas"><font face=
=3D"Consolas">
<p></p></font></font><font color=3D"#0000ff" face=3D"Consolas"><font color=
=3D"#0000ff" face=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas">pr=
otected</font></font></font><font face=3D"Consolas"><font face=3D"Consolas"=
> </font></font><font color=3D"#0000ff" face=3D"Consolas"><font color=3D"#0=
000ff" face=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas">void</fo=
nt></font></font><font face=3D"Consolas"><font face=3D"Consolas"> FileGridV=
iew_SelectedIndexChanged(</font></font><font color=3D"#0000ff" face=3D"Cons=
olas"><font color=3D"#0000ff" face=3D"Consolas"><font color=3D"#0000ff" fac=
e=3D"Consolas">object</font></font></font><font face=3D"Consolas"><font fac=
e=3D"Consolas"> sender, </font></font><font color=3D"#2b91af" face=3D"Conso=
las"><font color=3D"#2b91af" face=3D"Consolas"><font color=3D"#2b91af" face=
=3D"Consolas">EventArgs</font></font></font><font face=3D"Consolas"><font f=
ace=3D"Consolas"> e)
<p>{</p></font></font><font face=3D"Consolas"><font face=3D"Consolas">
<p>=A0=A0=A0=A0 txtFile.Text =3D FileGridView.SelectedRow !=3D </p></font><=
/font><font color=3D"#0000ff" face=3D"Consolas"><font color=3D"#0000ff" fac=
e=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas">null</font></font>=
</font><font face=3D"Consolas"><font face=3D"Consolas"> ? Server.HtmlDecode=
(FileGridView.SelectedRow.Cells[1].Text) : </font></font><font color=3D"#a3=
1515" face=3D"Consolas"><font color=3D"#a31515" face=3D"Consolas"><font col=
or=3D"#a31515" face=3D"Consolas">&quot;&quot;</font></font></font><font fac=
e=3D"Consolas"><font face=3D"Consolas">;
<p></p></font></font><font color=3D"#2b91af" face=3D"Consolas"><font color=
=3D"#2b91af" face=3D"Consolas"><font color=3D"#2b91af" face=3D"Consolas">=
=A0=A0=A0=A0 ProfileCommon</font></font></font><font face=3D"Consolas"><fon=
t face=3D"Consolas"> profile =3D Profile.GetProfile(Profile.UserName);
<p></p></font></font><font color=3D"#0000ff" face=3D"Consolas"><font color=
=3D"#0000ff" face=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas">=
=A0=A0=A0=A0 if</font></font></font><font face=3D"Consolas"><font face=3D"C=
onsolas"> (FileGridView.SelectedRow =3D=3D </font></font><font color=3D"#00=
00ff" face=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas"><font col=
or=3D"#0000ff" face=3D"Consolas">null</font></font></font><font face=3D"Con=
solas"><font face=3D"Consolas">) </font></font><font color=3D"#0000ff" face=
=3D"Consolas"><font color=3D"#0000ff" face=3D"Consolas"><font color=3D"#000=
0ff" face=3D"Consolas">return</font></font></font><font face=3D"Consolas"><=
font face=3D"Consolas">;
<p>=A0=A0=A0=A0 profile.</p></font></font><font color=3D"#ff0000" face=3D"C=
onsolas"><font color=3D"#ff0000" face=3D"Consolas"><font color=3D"#ff0000" =
face=3D"Consolas">User</font></font></font><font face=3D"Consolas"><font fa=
ce=3D"Consolas">.ImportId =3D </font></font><font color=3D"#2b91af" face=3D=
"Consolas"><font color=3D"#2b91af" face=3D"Consolas"><font color=3D"#2b91af=
" face=3D"Consolas">Convert</font></font></font><font face=3D"Consolas"><fo=
nt face=3D"Consolas">.ToInt32(FileGridView.SelectedRow.Cells[0].Text);
<p>=A0=A0=A0=A0 profile.</p></font></font><font color=3D"#ff0000" face=3D"C=
onsolas"><font color=3D"#ff0000" face=3D"Consolas"><font color=3D"#ff0000" =
face=3D"Consolas">Save</font></font></font><font face=3D"Consolas"><font fa=
ce=3D"Consolas">();
<p>=A0=A0=A0=A0 Response.Redirect(</p></font></font><font color=3D"#a31515"=
 face=3D"Consolas"><font color=3D"#a31515" face=3D"Consolas"><font color=3D=
"#a31515" face=3D"Consolas">&quot;~/Overview.aspx&quot;</font></font></font=
><font face=3D"Consolas"><font face=3D"Consolas">);
<p>}</p>
<p>=A0</p>
<p>The generated html from Firebug is :</p>
<p>=A0</p>
<div>
<div>
<div><span>&lt;<span>div</span><span>&gt;</span></span></div>
<div>
<div>
<div><span>&lt;<span>table</span><span>=A0<span>id</span>=3D&quot;<span>ctl=
00_ctl00_loggedOnDropDown_importDropDown_FileGridView</span>&quot;</span><s=
pan>=A0<span>class</span>=3D&quot;<span>FileGridViewClass</span>&quot;</spa=
n><span>=A0<span>cellspacing</span>=3D&quot;<span>0</span>&quot;</span><spa=
n>=A0<span>border</span>=3D&quot;<span>0</span>&quot;</span><span>=A0<span>=
style</span>=3D&quot;<span>
border-=A0=A0=A0 color:Black;border-width:1px;border-style:Solid;border-col=
lapse:collapse;</span>&quot;</span><span>&gt;</span></span></div>
<div>
<div>
<div><span>&lt;<span>tbody</span><span>&gt;</span></span></div>
<div>
<div>
<div><span>&lt;<span>tr</span><span>=A0<span>style</span>=3D&quot;<span>col=
or:White;background-color:#F24B31;</span>&quot;</span><span>&gt;</span></sp=
an></div></div>
<div>
<div><span>
<div>
<div><span>&lt;<span>tr</span><span>=A0<span>style</span>=3D&quot;<span>bac=
kground-color:#DDDDDD;</span>&quot;</span><span>=A0<span>onmouseout</span>=
=3D&quot;<span>this.style.backgroundColor=3D&#39;#EEEEEE&#39;</span>&quot;<=
/span><span>=A0<span>onmouseover</span>=3D&quot;<span>this.style.background=
Color=3D&#39;#999999&#39;</span>&quot;</span><span>=A0<span>onclick</span>=
=3D&quot;<span>javascript:__doPostBack(&#39;ctl00$ctl00$loggedOnDropDown$im=
portDropDown$FileGridView&#39;,&#39;Select$0&#39;)</span>&quot;</span>
<span>&gt;</span></span></div>
<div>
<div><span>&lt;<span>td</span><span>&gt;</span></span></div>
<div>
<div>
<div>
<div><span><b><font color=3D"#0000ff">&lt;<span>span</span><span>=A0<span>i=
d</span>=3D&quot;<span>ctl00_ctl00_loggedOnDropDown_importDropDown_FileGrid=
View_ctl02_importName</span>&quot;</span><span>&gt;</span><span><span>test =
2</span></span>&lt;/<span>span</span>&gt;</font></b></span></div>
</div></div>
<div><span>&lt;/<span>td</span>&gt;</span></div></div>
<div>
<div><span>&lt;<span>td</span><span>&gt;</span><span><span>23.09.2008</span=
></span>&lt;/<span>td</span>&gt;</span></div></div>
<div>
<div><span>&lt;<span>td</span><span>=A0<span>align</span>=3D&quot;<span>cen=
ter</span>&quot;</span><span>&gt;</span></span></div></div>
<div>
<div><span>&lt;<span>td</span><span>&gt;</span><span><span>12.09.2009</span=
></span>&lt;/<span>td</span>&gt;</span></div></div>
<div>
<div><span>&lt;<span>td</span><span>=A0<span>class</span>=3D&quot;<span>ali=
gn-right</span>&quot;</span><span>&gt;</span><span><span>99</span></span>&l=
t;/<span>td</span>&gt;</span></div></div></div>
<div><span>&lt;/<span>tr</span>&gt;</span></div></div>
<div></div></span><span>&lt;<span>tr</span><span>=A0<span>style</span>=3D&q=
uot;<span>background-color:#EEEEEE;</span>&quot;</span><span>=A0<span>onmou=
seout</span>=3D&quot;<span>this.style.backgroundColor=3D&#39;#DDDDDD&#39;</=
span>&quot;</span><span>=A0<span>onmouseover</span>=3D&quot;<span>this.styl=
e.backgroundColor=3D&#39;#999999&#39;</span>&quot;</span><span>=A0<span>onc=
lick</span>=3D&quot;<span>
javascript:__doPostBack(&#39;ctl00$ctl00$loggedOnDropDown$importDropDown$Fi=
leGridView&#39;,&#39;Select$1&#39;)</span>&quot;</span><span>&gt;</span></s=
pan></div></div></div></div>
<div><span>&lt;/<span>tbody</span>&gt;</span></div></div></div>
<div><span>&lt;/<span>table</span>&gt;</span></div></div></div>
<div><span>&lt;/<span>div</span>&gt;</span></div></div></font></font></div>
<div><span></span></div>
<p>=A0</p>
<p>=A0</p>
<p>To test this, I click on the grid row to try and trigger the onclick eve=
nt.</p>
<p>=A0</p>
<p><font face=3D"Tahoma">=A0=A0=A0=A0=A0&lt;clickElement xpath=3D&quot;//sp=
an[contains(@id, &#39;_importName&#39;) and contains(text(), &#39;test 2&#3=
9;)]&quot;/&gt; </font></p><font face=3D"Tahoma"></font></font></div>
<p><font face=3D"Consolas"><font face=3D"Consolas"><font face=3D"Tahoma"></=
font></font></font>=A0</p>
<p><font face=3D"Consolas"><font face=3D"Consolas"><font face=3D"Tahoma"></=
font></font></font>=A0</p>
<p><font face=3D"Consolas"><font face=3D"Consolas"><font face=3D"Tahoma">I =
get no errors calling the clickelement, but the onclick event does not seem=
 to be getting called.=A0 No re-direct is occurring to reload the Overview =
page.</font></font></font></p>

<p><font face=3D"Consolas"><font face=3D"Consolas"><font face=3D"Tahoma"></=
font></font></font>=A0</p>
<p><font face=3D"Consolas"><font face=3D"Consolas"><font face=3D"Tahoma">Do=
es anyone have any ideas why this might be happening.</font></font></font><=
/p>
<p><br></p>
<p><font face=3D"Consolas"><font face=3D"Consolas"></font></font>=A0</p>
<div><font face=3D"Tahoma">Kind regards<br>Sophie</font></div>
<div><font face=3D"Tahoma"><br>=A0</font></div>
<div><font face=3D"Tahoma">Sophie De Malet Roquefort</font></div>
<div><font face=3D"Tahoma">IT Department<br>0131 555 1100</font></div>
<div><font face=3D"Tahoma"></font>=A0</div>
<div><font face=3D"Tahoma">T: 0131 555 1100<br>F: 0131 555 6300<br>W: </fon=
t><a href=3D"http://www.datadiscoveries.com" target=3D"_blank"><font face=
=3D"Tahoma">www.datadiscoveries.com</font></a></div>
<div><a href=3D"http://www.datadiscoveries.com" target=3D"_blank"><font fac=
e=3D"Tahoma"></font></a></div>
<div><font face=3D"Tahoma"></font>=A0</div>
<div><font face=3D"Tahoma"><img src=3D"" alt=3D"Data Discoveries Logo"></fo=
nt></div>
<div><font face=3D"Tahoma"></font>=A0</div>
<div>
<p><font face=3D"Tahoma">
<p>Want to know more about data management? <a href=3D"http://www.datadisco=
veries.com/forms/whitepaper/whitepaper_bank/" target=3D"_blank">Download a =
whitepaper</a></p></font><br><font face=3D"Tahoma">
<p>Do you work in the non-profit sector? Come to our <a href=3D"http://www.=
datadiscoveries.com/industries/charities/best_practice_marketing_forum/" ta=
rget=3D"_blank">free event.</a></p></font>
</p><p></p></div>
<div><font face=3D"Tahoma"></font>=A0</div>
<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1">Please let me know =
if this e-mail address is not the best one to use. </font></div>
<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1"></font>=A0</div>
<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1">This e-mail is inte=
nded for the named addressee only. Its contents are private and confidentia=
l and should not be read, copied or disclosed to or by any other person. If=
 you have received this transmission in error, please notify the sender imm=
ediately by e-mail or telephone (0131 555 1100), delete the contents of thi=
s transmission and destroy any copies made. Copyright Data Discoveries Limi=
ted. All rights reserved. No part of this communication may be reproduced w=
ithout the prior written permission of Data Discoveries Limited.</font></di=
v>

<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1"></font>=A0</div>
<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1">Opinions, conclusio=
ns and other information in this message that do not relate to the official=
 business of Data Discoveries Limited shall be understood as neither given =
nor endorsed by it. Internet e-mails are not necessarily secure. Data Disco=
veries Limited does not accept responsibility for changes made to this mess=
age after it was sent or viruses transmitted through this e-mail or any att=
achment. You should carry out your own virus checking procedure before open=
ing any attachment to this e-mail. The e-mail and IT systems of Data Discov=
eries Limited are subject to random monitoring and recording by or on behal=
f of Data Discoveries Limited. </font></div>

<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1">Thank you.</font></=
div>
<div><font color=3D"#808080" face=3D"Tahoma" size=3D"1"></font>=A0</div>
<div><font face=3D"Tahoma"><font color=3D"#808080" size=3D"1">Data Discover=
ies Limited: Registered in Scotland with Registered Number SC157375. <br>Re=
gistered Office: 16/1 Timber Bush Edinburgh EH6 6QH. VAT Registration Numbe=
r: GB 663 8176 09.<br>
Member of the Direct Marketing Association.</font> </font></div>
<div><br><font face=3D"Tahoma">=A0</font></div>



_______________________________________________
WebTest mailing list
<a href=3D"mailto:WebTest@lists.canoo.com" target=3D"_blank">WebTest@lists.=
canoo.com</a>
<a href=3D"http://lists.canoo.com/mailman/listinfo/webtest" target=3D"_blan=
k">http://lists.canoo.com/mailman/listinfo/webtest</a>
</blockquote></div><br><br clear=3D"all"><br>-- <br>Lisa Crispin<br>Co-auth=
or with Janet Gregory, _Agile Testing: A Practical Guide for Testers and Ag=
ile Teams_ (Addison-Wesley 2009)<br>Contributor to _Beautiful Testing_ (O&#=
39;Reilly 2009)<br>
<a href=3D"http://lisacrispin.com" target=3D"_blank">http://lisacrispin.com=
</a><br>@lisacrispin on Twitter<br><a href=3D"http://entaggle.com/lisacrisp=
in" target=3D"_blank">http://entaggle.com/lisacrispin</a><br><br>

--0016364c7235e197cd04a7cbde50--