How do I verify the presence of an image by Katalon Studio? - automated-tests

I have the following line of code in my program to verify that the element is an image:
if (WebUI.verifyImagePresent(findTestObject('Co-Sponsor Sign Up/Account Information/SponsorLogo'), FailureHandling.CONTINUE_ON_FAILURE)) {
WebUI.takeScreenshot()
}
When I run it, it returns the following error:
<TestCaseName>FAILED because (of) Unable to verify image present (Root cause: java.lang.IllegalArgumentException: This object don't have IMAGE_FILE property, please add it)
I have specified the object to be located by the xpath of the image:
/html/body/div[2]/div[2]/div/div[2]/div[2]/span/a/img
What I am doing wrong? What do I need to locate the image by?

To use verifyImagePresent, you have to set both Object's Properties for Object (Id, XPath, class...) and the Image file at the "Image" field to compare. You can see the screenshot below:
Screenshot link
Then you can use the keyword as normal command:
WebUI.verifyImagePresent(findTestObject("Page_HTML Images/img_workplace"))

Related

Problems in Unity2D Unity:NullReferenceException: Object reference not set to an instance of an object

i have problem in Unity:NullReferenceException: Object reference not set to an instance of an object
Collectable.OnCollide (UnityEngine.Collider2D coll) (at Assets/Scripts/Collectable.cs:10)
Collidable.Update () (at Assets/Scripts/Collidable.cs:24)
In these scripts (Collectable and Collidable) I indicated that if the player approaches an object, then that object will change. Please help me.
This scripts:
enter image description here enter image description here
Maybe your script can't find the player try adding a tag to the player and then on line 10 :
if (coll.gameObject.CompareTag("tagName")){}

Watir: Problems trying to get the value of a field that's contained within an iframe

I'm trying to verify the text within a field that's held in an iframe using the shown in the image below.
When I run it I get this syntax error:
/opt/homebrew/lib/ruby/gems/3.0.0/gems/watir-6.19.1/lib/watir/elements/element.rb:857:in method_missing': undefined method value' for #<Watir::HTMLElement: located: false; {:width=>"100%", :tag_name=>"iframe"} --> {:id=>"P5533_COMPANY"}> (NoMethodError)
from temporary_exp.rb:83:in `'
If I use the code for performing a 'click' e.g. browser.iframe(:width =>"100%").element(id: "P5533_COMPANY").click then it works fine but for some reason it doesn't like 'value'. Any ideas?
This is the code I'm running
#value is not a method in Watir::HTMLElement object, which is what you get an instance of when you use #element method. Is the HTML element you are working with a Checkbox? (then use #checkbox instead of #element)

Node-Red Get File from SFTP

I am using Node-red to connect to SFTP and to get a file.
Th Problem is that it returns always this error:
"Error: sftp.realPath: The "string" argument must be of type string or
an instance of Buffer or ArrayBuffer. Received type number
(1645531908336) 1645531908336"
Note: I did not get this error on "List" and i have tried many SFTP servers. Always the same error
this is the image of my node
1645531908336 looks like it is the timestamp from a standard msg.payload value from an inject node.
Assuming this is the node-red-contrib-better-sftp node then it looks like it is badly written and will always take the value of msg.payload and override any configured path and filename in the node config. This is a really bad design and should only use the input message if the value is left blank in the config.
https://github.com/sublime93/node-red-contrib-better-sftp/blob/10f67d46f3d762b254f7a6f22539ba4c95d6331e/transports/sftp/index.js#L148
So the quick option for you to test is to remove the msg.payload from the inject node you are testing with.
You should also raise an issue with the nodes author to fix this behaviour.
EDIT: There already is an open issue (from mid 2020) https://github.com/sublime93/node-red-contrib-better-sftp/issues/9

Error while pressing the button " type object "my model" has no attribute "my action" - Odoo 10

I'm working on Odoo 10. When I click on the button, get mentioned error.
I want to convert a contact in partner so I need create a new line in another table with the values I put in the .create(vals).
The following links are some extracts of my code , hope you can help me.
my class : model.py
my view : model_view.xml
my error : server trace back
I don't understand your code at all. You inherit a model called test.res.partner and I don't know if you already created it. That may be the issue.
It could be also the fact that you may no be importing your model.py file if this module inherits another one that you have already created.
In general this message indicates that the method convert_prospect does not exist in the model test.res.partner.
But seeing how you write your view (like using xpath in a view that does not inherit from another one) you should rework your fundamentals.
Ah and don't call that prospect() at the end.

Retrieve explicit values from document library

I'm trying to pull some fields from my Document Library. Right now, I can retrieve these 2 fields to return the correct values, in my success function.
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
alert(oListItem.get_item('Title'));
alert(oListItem.get_item('UserField1'));
}
But when I try to call a computed field, such as 'NameOrTitle' oListItem.get_item('NameOrTitle')); I get IE telling me the property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
This value has content inside it right now. And I need it, as it's displaying the file name. How can I get this field? I have looked elsewhere and I have read stuff about doing:
context.load(allItems, 'Include(NameOrTitle)');
Then in my succeess function, I do oListItem.get_nameOrTitle(). Is this correct?
Well I do that and now I'm getting
Object doesn't support property or method 'get_nameOrTitle'
Please help. Thanks.
oListItem.get_item('FileRef');
Will get me the url

Resources