File upload test using Katalon when the 'browse' button isn't an input element - web-testing

I want to test a file upload but as opposed to the How to Handle File Uploads tutorial, the 'Browse' button in my case isn't an Input element.
I've attached a pic of the HTML script of the 'Browse' button:
html_script_img
and this is how it looks on the website:
webpage_img
How can I test a file upload in this case without dealing with the 'Open' explorer window?
Thanks.

There isn't any input fields in your code, so you can't use sendKeys() method. There isn't any field to receive it. You should click on browse button and handle file upload dialog with an AutoIT script or java.awt.Robot class.

Related

Prevent default (showing file dialog) on form file input in Bootstrap-Vue

I'm trying to override the default file browser dialog with a custom function when the user clicks on the file selection dialog as shown below in Bootstrap-Vue.
The code is
<b-form-file
v-on:click.prevent
v-model="file"
:state="Boolean(file)"
placeholder="Choose a file or drop it here..."
drop-placeholder="Drop file here..."
></b-form-file>
I tried adding v-on:click.prevent, and #click="function (e) {e.preventdefault()}" but those don't work for me.
https://bootstrap-vue.js.org/docs/components/form-file/
The way to prevent the default file browser from showing (and to run your own action on click) would be something similar to the following:
<b-form-file #click.native.prevent="alert('Hello world')"></b-form-file>

How to make file clickable in upload collection?

I am doing upload collection component in sap ui5. I want to make file clickable after upload. Previously uploaded files are getting clickable but currently uploaded files are not getting clickable. Please help me to find solution.
Below is my XML code :
You have not set the mode for the Upload list, by default this is set to None. Add a mode parameter in you List as below. This will make the List clickable.
mode="SingleSelectMaster"
Reference:
https://sapui5.netweaver.ondemand.com/#docs/api/symbols/sap.m.UploadCollection.html#getMode
https://sapui5.netweaver.ondemand.com/#docs/api/symbols/sap.m.ListMode.html

How to take screenshot of each link clicked in Selenium IDE

I want to click links in a webpage by storing it in array and click this links one after another and take entire screenshot of each and every link after clicked,and all this i have to do only in SELENIUM IDE...how to do that??
I know up to save links in array and clicking links, but failed to capture screenshot of each page after clicking..because it is taking only one screenshot and overwriting that screenshot when second link clicked..
Maybe the reason why your screenshots are being overwritten is because you have a consistent image file name for them. Try something like this:
Command:
captureEntirePageScreenshotAndWait;
Target:
C:\\<Directory>\\different-filename-for-screenshot.png
and so on and so forth...
If you have very less screens to capture then you can simply capture them in different file names. Please refer example below.
LessScreenshot IDE Script
LessScreenshot Files stored
If you have more screens to capture then you can read the file locations and names from CSV file. For more information about loop and readCSV, please refer this link. In the example below, I have capture 7 clicks screenshots.
Input_CSV_File
IDE_Script_Loop&ReadCSV
Screenshot captured

Hiding workflow re-assign button in Maximo

Is it possible to hide the re-assign button in the workflow dialog box for the users? and if so how?
Thanks
my solution may not be the best one, but it works for me. I hid the button using CSS.
Just go to the Application Designer app and use Export system XML action from Select Action dropdown. Then pick LIBRARY XML and save it somewhere on your disk. Open it (using WordPad preferably, Notepad is causing some issues when importing back to Maximo) and CTRL+F find Complete workflow assignment dialog. Go down a bit and you'll see <pushbutton> with label Reassignment:
<pushbutton id="completewf_b_4" label="Reassign" mxevent="directorinput" value="reassign"/>
Add textcss="reassign_btn" (the name is up to you of course)
<pushbutton id="completewf_b_4" label="Reassign" mxevent="directorinput" textcss="reassign_btn" value="reassign"/>
Then save the file and import LIBRARY.xml back to the Maximo using Application Designer app again. Then just edit your maximo.css file (located somewhere in \applications\maximo\maximouiweb\webmodule\webclient\ depending on which skin you are using) and add:
.reassign_btn { visibility: hidden; }
Hope this helps :-)

Access VBA: Form command button to do something/call function

I have created a basic form in access that has a couple of buttons and text fields.
I want the button to do something along the lines of when I click it, it should bring up a browse file dialog and when I select a file, change the text field to the path of the file.
My question is how can I program this? Specifically, do I create a module that goes like?
sub command1_onClick()
..bla bla...
end sub
Or are forms programmed differently? How can I tie a function to a button?
You can add actions to the button. In the properties window of the button is an Event-Tab. Click on On Click and select Event Procedure. You are then taken to the VBA Editor (ALT+F11) into following procedure:
Private Sub Command1_Click()
End Sub
In that procedure, you can use an API call to open the standard file dialog:
API: Call the standard Windows File Open/Save dialog box
The TestIt function in above link shows you hove to open the dialog and get the path. You can set your textbox to that path like this:
Me!Text1 = strPath
strPath has to be populated with the path you get from the file dialog.
You will want to look at the file dialog property.
Dim fDialog As Office.FileDialog
MSDN File Dialog
The above shows an example that is performed on a button click
The example adds the selected file to a listbox, for your situation you would want to use a simple textbox instead of the listbox.
You may want to set AllowMultiSelect to false to ignore the looping part if you only want one item. (this would simplify the code in the example for you.
.AllowMultiSelect = false
I may be a lil rusty but then you would want to do something like this(someone edit or correct me if I am way off)
Assuming you used varFile
(Dim varFile As Variant)
Me.TextBox1.Text = varFile
EDIT: After encountering error
It seems the error can come froma few things. Check to make sure the reference is there.
Also you may need to add the Microsoft DAO 3.6 Object Library reference.
See the "More information" section of this Link (Hopefully 2002 is close enough to 2003)
. It may have a few more helpful tips if that doesn't solve the problem.