Ask a Question

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

 

3 REPLIES 3
VeenaDevi
Contributor

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 

sureshkumar9620
Occasional Contributor

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

Hi Suresh,

 

Script approach is exactly the same:

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

Project.Variables.<YourVariable> = strText;

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: