Forum Discussion

sureshkumar9620's avatar
sureshkumar9620
Occasional Contributor
4 years ago
Solved

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

 

 

 

 

Thanks

Suresh

 

  • 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 

3 Replies

  • 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's avatar
      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

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Suresh,

         

        Script approach is exactly the same:

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

        Project.Variables.<YourVariable> = strText;