Ask a Question

Select Items from dropdown list in different ways

SOLVED
Adagio
Frequent Contributor

Select Items from dropdown list in different ways

Hello,

 

I've to select values from a dropdown( one value at a time), but when I use the object mapping, it takes too long to locate the object. I see that the object has an Id. Is there a way I can access this object directly using it's Id and then select item from the drop-down?  Can I use document.getElementById() ?

 

any help would be appreciated!

 

Thank you
Abhi

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Select Items from dropdown list in different ways

Hi Abhi,

 

Take a look at these articles that describe how to use the "Find" methods:

 

Finding Web Objects Using Specific Find Method

 

Finding Web Objects Using Common Find Methods

 

I hope this helps. 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

4 REPLIES 4

Re: Select Items from dropdown list in different ways

Hi Abhi,

 

Take a look at these articles that describe how to use the "Find" methods:

 

Finding Web Objects Using Specific Find Method

 

Finding Web Objects Using Common Find Methods

 

I hope this helps. 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

AlexKaras
Community Hero

Re: Select Items from dropdown list in different ways

Hi Abhi,

 

> Can I use document.getElementById() ?

Yes, you can but this is not recommended because of performance and convenience reasons.

.FindXXX() methods as mentioned by @YuriPeshekhonov are recommended and more preferable approach in TestComplete.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Adagio
Frequent Contributor

Re: Select Items from dropdown list in different ways

Thanks Alex! this works 🙂

Adagio
Frequent Contributor

Re: Select Items from dropdown list in different ways

Thank you for suggesting Page.NativeWebObject.Find method, Yuri! I didn't know about this approach. This is really helpful.

 

Thank you

Abhi

cancel
Showing results for 
Search instead for 
Did you mean: