cancel
Showing results for 
Search instead for 
Did you mean: 

How to Store value which extract from web element and re-use it --Keyword testing

SOLVED
Highlighted
New Contributor

How to Store value which extract from web element and re-use it --Keyword testing

Hi,

I'm new to TestComplete tool and facing following issue while doing the pilot project. it would be highly appreciate if you can help on this matter.

Requirement : Store value (create local variable) and assign value from the web element. and after few step i need to write on that value on text box.

Tried : I tried with "Set Variable"command but i'm unable to select unique property from relevant web element as there is no any unique property than the contentText (that is the value which i need to store and it getting change during the each execution cycle)

 

Note : attached screen for the reference

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How to Store value which extract from web element and re-use it --Keyword testing

Hi,

 

Yes, Set Variable is the way to go.

I would recommend to enable Advanced view in both Object Spy and Object Browser to see more properties (click the View More Members... link present on your screenshot).

Also talk to your developers and ask them to provide stable and unique identifiers for the web elements you are going to interact with in your tests. Absence of unique and stable identifiers will result in flaky and fragile tests even if you try to use XPath. (As you might decide to try or are convinced to use by others.)

 

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
================================

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Re: How to Store value which extract from web element and re-use it --Keyword testing

Hi,

 

Yes, Set Variable is the way to go.

I would recommend to enable Advanced view in both Object Spy and Object Browser to see more properties (click the View More Members... link present on your screenshot).

Also talk to your developers and ask them to provide stable and unique identifiers for the web elements you are going to interact with in your tests. Absence of unique and stable identifiers will result in flaky and fragile tests even if you try to use XPath. (As you might decide to try or are convinced to use by others.)

 

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
================================

View solution in original post

Highlighted
Community Manager

Re: How to Store value which extract from web element and re-use it --Keyword testing

Thanks for the help, AlexKaras!

@sudam_SL, is this what you were looking for?

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

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors