cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch the id from the select tag inside the table tr td in javascript

SOLVED
Highlighted
New Contributor

Fetch the id from the select tag inside the table tr td in javascript

Can you please help me in fetching the id and token id from the below select tag

 

<table>

<tbody>

<tr>

<td>

<select tabindex="-1"  id="c2bed32656751f63620b" aria-hidden="true" tokenid="1a4a9ea8-2043-4447-9634-de03fca5fb26">
    <option value="">Actions</option>
    <option value="documents">Documents</option>
    <option value="continue">Edit </option> 
</select>
<span class="select2 select2-container select2-container--bootstrap js-dropdown-actions-template js-dropdown-actions js-dropdown-actions-events" id="s2id_c2bed326-2233-4642-b046-56751f63620b" dir="ltr">

</td>

</tr>

<tr>

<td>

<select id="xxx" tokenid="xxx">

</td>

</tr>

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Fetch the id from the select tag inside the table tr td in javascript

Hi @vsubbu,

I would suggest that you treat your HTML as XML. In this case, you can use XPAth to easily get the needed attribute. Please refer to the following article  for more information:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

Community, your suggestions?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
2 REPLIES 2
Community Manager

Re: Fetch the id from the select tag inside the table tr td in javascript

Hi @vsubbu,

I would suggest that you treat your HTML as XML. In this case, you can use XPAth to easily get the needed attribute. Please refer to the following article  for more information:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

Community, your suggestions?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Contributor

Re: Fetch the id from the select tag inside the table tr td in javascript

Thanks. 

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2