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.

script Clicks both Parent and Pop window field

keatskeats Members
edited November -1 in Sahi - Open Source
I have a field/link called "Search" which is present in both Parent window and the popup window.
I want to click on Pop up Search link, so i use the following code.
but it doesn't seem to work like I want.
I am using SahiV35 released on 2011-07-19.

_selectWindow("windowname");
[... do something i.e. extract regular expression and store in a variable. I don't do any browser actions or anything in the UI]
_click(_link("Search));

Issue : The Search link is clicked twice both in parent and pop up at the same time. This will change the Parent UI values and I loose the parent page.

Can somoene tell me what is the solution for this?

Thanks in advance.

Comments

  • narayannarayan Administrators
    Can you explicitly try with

    _popup("windowname")._click(_link("Search));

    and check the behaviour?
  • Ok, I will Try, But I require this becuase its conditional i.e. after second record the pop opens with same fields the first time it adds record to the parent window . So i was trying to reuse the code each time it adds the values. anyway I will let you know.
    Thanks Narayan.
  • Hi Narayan,

    Well i fixed this problem by traversing thru dom elements and it worked. I still get to use SelectWindow().
    _click(top.document.getElementById('SearchID'));

    Thanks.
This discussion has been closed.