Actually, this is a real problem with asynchronous code like Protractor and the one I am facing. The problem is that all of your commands are placed in the command queue before they are executed, so trying to put gettext () in a variable and use it later (for example, to check consistency between pages) requires a deep understanding of the difference between "parsing time" and "runtime "
Your best option is to do something like this:
describe('SuperCalculator Page', function() { beforeEach(function(){ browser.get('http://juliemr.imtqy.com/protractor-demo/'); }); it('gets row count and first column value', function() {
This is an ugly way to do something because it adds a layer of nested brackets / brackets, but it works great. If you need to capture more variables later, just end the current then () and stick with the other (multiple nesting with then () statements is bad practice).
I donβt really like this solution, so I'm looking for another (even if I need to encode it myself), but so far this is the best I have found.
Isaac lyman
source share