Forum Discussion

MaheshMoluguri's avatar
MaheshMoluguri
New Contributor
2 months ago

How to store values from web browser table

how to store values from web browser table dynamically through keyword and script (java)?

  • scot1967's avatar
    scot1967
    Regular Contributor

    There are many options for storing data.  Do you need it only during the current test (variables, arrays, objects), to pass to or use in other tests (project/suite variables) or do you need file storage like Excel or an external datastore file with a JSON object? 

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Regular Contributor

    On the first step you narrow down the row/column cell to read, I understand that you have this covered as your question is on how to store the value and not isolate to read.
    On the second step you store the value in a variable that can reside in three different locations:
    1-Project Suite
    2-Project
    3-Script 
    In "Project Explorer" right click to Edit > Variables
    One thing to keep in mind is the variable type and converting type.

    In KeywordTests use the "Set Variable Value" Operations

    In Script 

    function Test1()
    {
      var Var1;
      Var1 = "";
      Var1 = Aliases.browser.pageW3schoolsTryitEditor.frameIframeresult.cell.contentText;
      Log.Message("On screen value: " + Var1, "");
    }