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.

How to open a HTML file in the script

DsahiDsahi Members
edited April 2014 in Sahi - Open Source
Im trying to open a html file called "xxposting.html"
window.open('xxPosting.html'); tried to test it works but when given in script it fails.
Please could anyone help me at the earliest.
Thanks,

Best Answer

  • When you want to do some sahi stuff like assertions on the xxPosting, you will need a server providing this file.

    maybe some information why you want to open this file would help

Answers

  • DsahiDsahi Members
    Thanks for your reply.
    Need to do the following,

    1.Open the xxposting.html (tried to open it with _navigate "http://xxtesting/_s_/spr/xxPosting.html";)
    2. "Browse"to Upload xml file and "Submit Query"

    Assert-->Browse amd submit query button available on the page
    -->Upload xml file and submit it successfully

    point 1 successful but point 2 fails doesnt recognize the buttons !! tried with _setfile the error received is _setFile(_sahi._file("file"), "C:\\sahi\\userdata\\scripts\\Client6.xml");< did not complete in 150 seconds.
  • DsahiDsahi Members
    Thanks Globalwarming !!!
    Done with server providing the file.
    Please could you explain the difference between setFile and setfile2.
  • DsahiDsahi Members
    Hello Wormi,

    Now Im struck after opening the html file in the same window -how to go a new url?

    Tried _navigateTo getting this error
    ERROR
    Step >_sahi._navigateTo("http://xxxtesting/xxx/login.htm";);< did not complete in 150 seconds. at Apr 29, 2014 11:47:59 AM

    Regards
  • DsahiDsahi Members
    Please could anyone look into it ?
Sign In or Register to comment.