Ask a Question

Project Variables not applying at run time.

Novari-QA
Frequent Contributor

Project Variables not applying at run time.

In my project, we have a test case that requires the data to be up todate. We click a value on the screen that is linked to a project variable. and the name mapping object uses that project variable in order to decide what day to select.

I want to define 1 cell in the calendar. use a project variable to define which day to select, and define the variable at run time. However, it doesn't seem to be applying at run time. I'll say X = 2, run the project output the result, for some reason it comes out as x = 31 (idn why).  Then i run the project again, and X now = 2. But it isn't fully applied to the name mapping feature.


If anyone has time, id love to go into more details.

8 REPLIES 8
baxatob
Community Hero

Re: Project Variables not applying at run time.

Hi,

 

Pls show the code, where you have assign the variable and where your call it.

Marsha_R
Community Hero

Re: Project Variables not applying at run time.

Please also show where the variable is defined in the project.  I have seen strange results in tests that came from a variable accidently getting defined as Object or something else when it should have String or whatever was expected.

Marsha_R
[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
Novari-QA
Frequent Contributor

Re: Project Variables not applying at run time.

Here is the code, and some screen shots. Hopfully it will clear up what is wrong. Perhaps I am doing it wrong.

Run the routine "Foo"
See Results.
It trys to drag the same object twice but clearly I am updating the objects name

baxatob
Community Hero

Re: Project Variables not applying at run time.

 

Looks like you are using the same Page object twice. Once it was instantiated for Andrew, it also using for Novari.

 

 

Novari-QA
Frequent Contributor

Re: Project Variables not applying at run time.

Yes i am, and thats not the problem. The page object is a class not a name map. 

baxatob
Community Hero

Re: Project Variables not applying at run time.

Can you show, how you have instantiated the Page ?

Novari-QA
Frequent Contributor

Re: Project Variables not applying at run time.

dCompactorPage.PNGCompactorPage.PNG


Here are the 2 .js files. 

The issue i am having is that I am saying. HEY under unbookedDiv, grab the object and drag it over to BookedDiv. (no problem). Now I am saying HEY under unbookedDiv grab the other object and drag it over to BookedDiv. 

But... it doesn't work, it trys to grab the original object again and drag it from bookedDiv to BookedDiv. 

Funny thing is, if i tell it to: HEY under unbookedDiv Grab the other object and drag it to over to UnbookedDiv, it will take the original Object in booked and drag over to unbooked.......


baxatob
Community Hero

Re: Project Variables not applying at run time.

Yes, that what I said.

 

You create Page object only one time:

 

var Page = new dCompactorBlockPage();

This object store all properties relevant to the moment of its creation. This is the same object always, when you call it from BookCase() function. Changing the value of Project.Variables.CaseName does not affect to this object.

 

Try to create the Page inside BookCase() function:

 

function BookCase(pCaseName) {
  Project.Variables.CaseName = pCaseName;
  var Page = new dCompactorPage();
  Log.Message. ... 
  ...
}
cancel
Showing results for 
Search instead for 
Did you mean: