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.

Problem with Automating gmail web page (HTTPS SSL certificate error)

AdityaDhingraAdityaDhingra Members
edited November -1 in Sahi - Open Source
Hi Everyone,

I have just started using sahi so i was just playing around with it , it worked great with http pages but as soon as i started automating gmail webpage i got HTTPS SSL certificate warning . I have read almost all the earlier posts and have tried almost everything including changing the path , installing the certificates , and setting the same proxy for ssl connections .But the problem is that the script stops working as soon as the gmail login page appears. I tried my level best to solve this problem myself but getting the same problem. I really have great expectations from Sahi and i would be very thankful if anyone could help me with it.

Comments

  • narayannarayan Administrators
    Hi Aditya,

    Can you try using the Sahi Pro version? It automatically accepts certificates, so you will know if the problem was because some certificates were missing.

    Apart from that, once logged in on Gmail, there are some Comet like persistent requests open from the browser, so you need to add

    xhr.wait_ready_states=2

    to userdata.properties (Dashboard -> Configure -> userdata.properties; Add, save and restart Sahi)

    Regards,
    Narayan
  • Thanks for the reply.
    Yes, i tried using Sahi Pro and it works great with no warnings .

    But with Sahi Open Source i downloaded all the certificates and still i was getting the same problem that the script used to get stuck at login page then i made some changes in the code.
    I was calling this constructor
    browser = new Browser(browserPath, browserProcessName, browserOption);

    And as soon as i changed to browser = new Browser("firefox");
    everything worked fine.

    It was little strange , wondering why the script get stuck at login page when i call the constructor with three parameters.

    And i have a small query about finding the elements by html tag names(like By.tagName in Webdriver) and how to get the row count in a table , i wanted to select all the elements with <b> tag inside the table so that i can get all the unread mails .

    Thanks a lot once again.
  • Hi Narayan,

    I am actually planning to collect all the rows of a table within a list and the searching for the cells with tagname <b> which will give me all the unread mails .

    Actually i am planning to talk to my team lead to use sahi from our next project as we got fed up of putting sleep and waitfor everywhere for ajax elements and we faced lots of problem while using webdriver . But when i automated the same flow with sahi i din have to use any waitfor or sleep , it was wonderful that it automatically waits for ajax elements and i din have to switch to another frame it automatically did that . I was quite impressed and believe me i want it to have all the functionalities that webdriver has . I was looking at sahi java api and i was quite impressed that it has lot of methods that wud make ur life easier . But still needs to be richer like i missed find element bytagName method . Seriously if i can perform all the functions wid sahi i wud always prefer sahi and i am planning to give a presentation on it so that ppl get to know abt it and we can start using it instead of tellurium and webdriver. Its a great tool and we would love to have more examples, richer Java API and tutorials and detailed documentation for those who are using Java API.

    I would look forward for ur reply.
    Thanks

    Hats off to Sahi team!
  • narayannarayan Administrators
    Hi Aditya,

    Thanks for the kind words.

    You can do this to get the count of all B tags:

    int count = browser.bold("/.*/").in(browser.table("your_table_id")).countSimilar()

    will give you a count of all similar bold elements


    List<ElementStub> els = browser.bold("/.*/").in(browser.table("your_table_id")).collectSimilar();

    will give you a list of all elements which are similar to the criteria you provide.

    You should be able to see these APIs in the bundled JavaDoc, (we realized we had not updated on the website. We will do that.)

    Regards,
    Narayan
  • Thanks a lot for ur great help ..
This discussion has been closed.