18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Need help please - Popup name dynamic - Ajax popup

cateamcateam Members
edited March 2011 in Sahi - Open Source
Hello,

I am facing a problem to target my popup window. Indeed, this one is created dynamically by a javascript and has a name changing at each creation.

The popup seems to contain <div> tags.

I am not a professionnal of ajax or other dynamic language.

Does anybody has an idea to point my popup ? I need to click on a checkbox element.

I have the id of the checkbox element so I know how to click on it. But I am not able to find my popup.


I communicate you the source code :

<body cellspacing="0" cellpadding="0" bgcolor="#DEE3FD" onLoad="LoadBody()" onmousemove="DragEnCoursEnfant();">

<DIV class=popper id=topdeck></DIV>
<SCRIPT src='../../LibCopNet.js'></SCRIPT>
<!--Calendrier-->
<script src='../../LibCopCalendar.js'></script>
<!-- -->
<TABLE id="TablePrinc" border="0" cellspacing="0" cellpadding="0" width="400" >
.........
</TR>
<tr>
<td width="40%"><font class="def">Avec prévisualisation</font></td>
<td width="60%"><input type="checkbox" name="EdPreview" onclick="if (document.forms(0).CbEditique.checked){return false}" ></td>
</tr>
.........
</table>
</td>
</tr>
</form>
</table>
<div id="idCalqueEnregistrementEnCours" style="position:absolute; width:253px; height:80px;
z-index:10; left: 15px; top: 20px; border: 1px none #000000; visibility: hidden" class="cadreEnregistrementEnCours">
</div>
</body>


Thanks a lot by advance for your help

Cateam

Comments

  • narayannarayan Administrators
    Hi cateam,

    Could you specify how Sahi records the step? (We will know what the window name is and what expression can be used to identify the window). Do the dynamic window names follow any pattern?

    Thanks,
    Narayan
  • cateamcateam Members
    edited March 2011
    Hello Narayan,

    Thanks for your reply.

    When I record the step, it is displayed :

    _popup("New340")._click(_checkbox("EdPreview"));


    I tried to get the window with this line :

    _popup("/.*/")._click(_checkbox("EdPreview"));

    but it doesn't work. Probably because the ajax window is opened into another HTML Popup.

    I mean, I am in a HTML popup and I click on a link which triggers a javascript command opening a little window popup (with <div> tags). It looks like Ajax language but I am not sure.


    Same thing for that :
    _popup(/New.*/)._click(_checkbox("EdPreview"));

    It doesn't work.


    Thanks again for your help.

    Have a good day

    Cateam
  • cateamcateam Members
    Hello,

    Please anyone can help me ?

    Thanks a lot by advance


    Have a good day


    Cateam
Sign In or Register to comment.