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.

Domainfix is not working properly

lshankar_mcalshankar_mca Members
edited November 2011 in Sahi - Open Source
Hi Narayan,


I have an issue with domains.
When I record using with the sahi recorder my application is recording as:

browser.domain("mav.clpa.local").textbox("_ssoUser").setValue("Test"); ---url (http://mav.clpa.local/lawson/portal)
browser.domain("mav.clpa.local").password("_ssoPass").setValue("Test"); ---url (http://mav.clpa.local/lawson/portal)
browser.domain("mav.clpa.local").submit("Login").click();---url (http://mav.clpa.local/lawson/portal)
browser.textbox("findText").setValue("ap190"); ---url (http://mav.clpa.local/lawson/portal)
browser.button("LAWMENUBTNSEARCH2").click();---url (http://mav.clpa.local/lawson/portal)
browser.domain("clpa.local").textbox("JOB-NAME").setValue("AP190JV01");---url (http://mav.clpa.local/lawson/portal)
browser.domain("clpa.local").textbox("JOB-DESCRIPTION").setValue("test");---url (http://mav.clpa.local/lawson/portal)
browser.domain("clpa.local").textbox("PAY-GROUP").setValue("110");---url (http://mav.clpa.local/lawson/portal)
browser.button("Add").click();---url (http://mav.clpa.local/lawson/portal)
browser.domain("clpa.local").button("Submit").click();---url (http://mav.clpa.local/lawson/portal)
browser.button("Continue").click();--url (http://mav.clpa.local/lawson/portal/reports/jobsubmit.htm)

To remove domain prefix i added the following line to the Domainfix.txt file under userdata/config folder.

mav.clpa.local clpa.local

then sahi is recording the script without the domain prefix.

But here I am getting the another issue.
In my script after clicking the "Submit" button one popup page will open and that popup window contain one button "Continue" button.

But if I run the script from sahi its opening the blank popup window. (url is: http://mav.clpa.local/lawson/portal/reports/jobsubmit.htm)

Then I added the following regular expression to the exclude_inject.txt file
.*jobsubmit[.]htm

Now its showing the popup window contents but sahi is not clicking the "Continue" button.
Please help me how to resolve this issue.


Regards,
Shankar L

Comments

  • Please help to resolve this issue.

    Regards,
    Shankar L
  • Hi lshankar_mca,

    Kindly find the reference to the popup window and use the following code.

    The html code is:
    <html>
    <head>
    <script>
    var win22;
    function createPopup(){
        win22 = window.open("blank.htm", "win", "location=1,status=1,scrollbars=1,  width=200,height=200");
        win22.document.write('<input type="button" id="mybutton" value="Continue">')
    }
    </script>
    </head>
    <body>
    <input type="text"  id="main_textbox" value="test">
    <input type="button" onclick="createPopup()" value="Click me">
    </body>
    </html>
    

    The way you click on continue button is:

    _click(win22.document.getElementById("mybutton"));

    This is a work around to handle the popup if Sahi is not able to identify the elements on it.

    Let me know if this solves you issue.

    Regards
    Sumitra
Sign In or Register to comment.