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 get dynamic IDs of a webpage?

sridatta_spsridatta_sp Members
edited July 2014 in Sahi - Open Source
We have a usecase where creation of a newly object gets dynamic id and we have to pass that id in drag and drop feature, so how do we do it?

Example:
Create a object 'abc' ; its id is shown as _div("dynamic")
Create same object by name 'def' ; its id is shown as _div("dynamic[1]");
Continue same now id is shown for third object as _div("dynamic[2]");

Now how to capture this id as shown in above example, please help

Answers

  • You can do it by regular expression something like
    _setStrictVisibility(true)
    _div("/dynamic/");//drag the div
    _setStrictVisibility(false)
    StrictVisibility should be set to true to ensure that the elements availible in the current screen are only being used to perform the actions specified
Sign In or Register to comment.