Open MyGg29 opened 3 years ago
If you create node.target based on something present in
msg
, thenode.target
of the click-on node will be overwritten silently and you won't be able to set it again without redeploying.Example flow https://pastebin.com/b1iED30M
Now call with postman (or anything)
with payloads :
{ "text": "Create a free Team" }
then{ "text": "Join the community" }
The webdriver won't click on the right bloc on the second execution.
This is because node.target is overwritten by reference there : https://github.com/cuongquay/node-red-contrib-selenium-webdriver/blob/57dae4d154c1728c20a9ac89bb78a053783f0f08/selenium-webdriver.js#L76
Indeed, when you do a node.target = "anything", the change will travel back to the actual node because node is an reference to an object. The change will not be reflected in the node red interface At the next execution, the ternary will take
node.target
instead ofmsg.target
becausenode.target
was set at the previous execution silently.This is a pretty big bug and I'm supprised nobody is complaining about that.
The same bug exists for node.selector, node.timeout, etc
Hi MyGg29. Thank you for your comment. If you are using this node and be able to create a patch for everyone. You are welcome to be a contributor and I would be an honor to do a merge. I haven't used this node for years so there is no maintenance effort in my side.
If you create node.target based on something present in
msg
, thenode.target
of the click-on node will be overwritten silently and you won't be able to set it again without redeploying.Example flow https://pastebin.com/b1iED30M
Now call with postman (or anything)
with payloads :
{ "text": "Create a free Team" }
then{ "text": "Join the community" }
The webdriver won't click on the right bloc on the second execution.
This is because node.target is overwritten by reference there : https://github.com/cuongquay/node-red-contrib-selenium-webdriver/blob/57dae4d154c1728c20a9ac89bb78a053783f0f08/selenium-webdriver.js#L76
Indeed, when you do a node.target = "anything", the change will travel back to the actual node because node is an reference to an object. The change will not be reflected in the node red interface At the next execution, the ternary will take
node.target
instead ofmsg.target
becausenode.target
was set at the previous execution silently.This is a pretty big bug and I'm supprised nobody is complaining about that.
The same bug exists for node.selector, node.timeout, etc