18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Extract automatic id=
Hello,
I decided to use Sahi for my testing project.
Unfortunately, after a few clicks I encountered a problem. In a page, there are some more textareas, combos and date-pickers to fill in.
Each of them has this specific id and name in the source code:
id="Blah___blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee" name="Blah___blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee"
What I want is to extract this token (fe27a13d-8f2c-4fd1-a5b2-a98c835995ee), because I need it when set and submit the values.
I have found that the matching regexp is: /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/, but I don't know how to use it in order to keep the token for later use in the page.
Thank you very much,
B
I decided to use Sahi for my testing project.
Unfortunately, after a few clicks I encountered a problem. In a page, there are some more textareas, combos and date-pickers to fill in.
Each of them has this specific id and name in the source code:
id="Blah___blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee" name="Blah___blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee"
What I want is to extract this token (fe27a13d-8f2c-4fd1-a5b2-a98c835995ee), because I need it when set and submit the values.
I have found that the matching regexp is: /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/, but I don't know how to use it in order to keep the token for later use in the page.
Thank you very much,
B
This discussion has been closed.
Comments
If I were you I would ignore those ids totally. Look for some other way of identifying it using _near or _in. Have a look at http://sahi.co.in/w/sahi-api-examples
Regards,
Narayan
I have used
_alert(_textbox(_near("Blah_blah")));
and I have this error:
TypeError: Object doesn't support this property or method.
In the page, the name is Blah_blah
and
in the HTML source, the object is:
<input class="validation integerValidation" id="Blah_blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee" name="Blah_blah___fe27a13d-8f2c-4fd1-a5b2-a98c835995ee" type="text" value="" />
I'm testing on IE7.
Kindly use:
_alert(_textbox(0,_near(element)));
Regards
Sumitra
It was very simple. Being the first textbox in my page, I have used:
_setValue(_textbox(0), "1111");
Thank you all for helping!