Forum Discussion
> There is no Text type to select.
'text' is the name of the property, not its data type. As you are working with web page it must be of string type.
This is true it is a string type.
> the variable is not getting stored.
How do you store it?
I am storing at the Project level
> Aliases.browser.pageUntitledDocument.table2.textboxMfhreport.contentText
Does the Aliases.browser.pageUntitledDocument.table2.textboxMfhreport object exist?
Yes this object exists and this is the set variable object mapping.
Hi,
> I am storing at the Project level
Yes, I can see this from your code. Can you provide the code that assigns a value to the Project.Variables.
Also, what value do you expect to be stored in this variable?
- saranoor7 years agoFrequent Contributor
The new Medferreport generates a sytem ID and it can be a two digit number, eg 32, 32-A, 32-1.
This is the ID that I am storing in teh global variable.
I am going to another screen where there is a list of reports and I need to open the report that has the report ID stored in Global variable.
Below is ascreenshot of the report list wher I need to open the report from.
MedferREportList
- AlexKaras7 years agoCommunity Hero
Hi,
> Can you provide the code that assigns a value to the Project.Variables.
MedferReportNumber variable? OK... It is my understanding that for some reason you prefer not to share your code with us...
Then, just for curiosity, try this code:
function foo(){Project.Variables.MedferReportNumber = "32-A";Browsers.Item(btIexplorer).Run("http://fred01/index.cfm?fuseaction=MEDFR.OneProject&key=28942
&stid=1&apid=2");var Page = Sys.Browser().Page("*fred01*");Page.Wait();var itemCount = Aliases.browser.pageUntitledDocument.table;if (!itemCount.Exists)Log.Error("itemCount object was not found");// Sys.Browser("iexplore").Page("http://fred01/index.cfm?fuseaction=MEDFR.OneProject&key=28942
// &stid=1&apid=2").Table(1);Log.Message(Project.Variables.MedferReportNumber);var test1 = itemCount.FindChild("text", Project.Variables.MedferReportNumber, 50);
if (!test1.Exists)Log.Error("test1 object was not found");test1.DblClick();
} - saranoor7 years agoFrequent Contributor
function foo()
{
var itemCount = Aliases.browser.pageUntitledDocument.table;
//Sys.Browser("iexplore").Page("http://fred01/index.cfm?fuseaction=MEDFR.OneProject&key=28942&stid=1&apid=2").Table(1);
//Log.Message(Project.Variables.MedferReportNumber);
var test1 = itemCount.FindChild("text","Report 41",5);
Log.Message("Report6 "+Project.Variables.MedferReportNumber);
//console.log(test1);
test1.DblClick();
}This is the script that I wrote.
- saranoor7 years agoFrequent Contributor
Still struggling
function foo()
{
var itemCount = Aliases.browser.pageUntitledDocument.table;
// var itemCount = Aliases.browser.pageUntitledDocument.table2.textboxMfhreport.Click();
//Sys.Browser("iexplore").Page("http://fred01/index.cfm?fuseaction=MEDFR.OneProject&key=28942&stid=1&apid=2").Table(1);
//Log.Message(Project.Variables.MedferReportNumber);
var test1 = itemCount.FindChild("text","Report 41",5);
Log.Message("Report6 "+Project.Variables.MedferReportNumber1);
//console.log(test1);
test1.DblClick();
}