cancel
Showing results for 
Search instead for 
Did you mean: 

KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

SOLVED
sureshkumar9620
Occasional Contributor

KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

Hi ,

Query :How to capture the dynamic value in the web page and store it in variable? So that i can search with this variable in the next webpage. Pl find the below screen shot

steps to reproduce :

1) Through KeywordTests recording, I have navigated to website and created a request. it has created a request number (dynamic) something like "Tempso-123'' as shown in the below screen shot

2) Now i need to login with different role and i need to search the above value(Tempso-123) and i need to be approve/reject request.

 

How to handle this scenarios ? can anyone please guide me

 

 

sureshkumar9620_0-1617007233473.png

 

 

Thanks

Suresh

 

1 ACCEPTED SOLUTION

Accepted Solutions
VeenaDevi
Occasional Contributor

Re: KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

1. Create project Level variable 

2.use Set Variable Value step (in Keyword Test)

3. Use Object Property and get Context Text. (select the Tempso-123 text area)

You can reuse this Variable anywhere in your project to fetch this value 

View solution in original post

3 REPLIES 3
VeenaDevi
Occasional Contributor

Re: KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

1. Create project Level variable 

2.use Set Variable Value step (in Keyword Test)

3. Use Object Property and get Context Text. (select the Tempso-123 text area)

You can reuse this Variable anywhere in your project to fetch this value 

View solution in original post

sureshkumar9620
Occasional Contributor

Re: KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

Thanks for the reply. I have followed your instructions and it is working as expected through keywordTests

 

I would like to do the same through  JavaScripts : web page : How to store dynamic value in the webpage and how do i call it ?

 

 

Thanks

Suresh

AlexKaras
Community Hero

Re: KeywordTests : web page : How to store dynamic value in the webpage and how do i call it ?

Hi Suresh,

 

Script approach is exactly the same:

var strText = Aliases.Browser.Page.<Control>.wText;

Project.Variables.<YourVariable> = strText;

 

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
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors