How can i click on an item that is freshly created with an automated test? - katalon-studio

How can I click on an item that is freshly created with an automated test using katalon?
In my katalon script I am adding one record and immediately I want to edit that record. So I want to identify the new one among old records.
WebUI.click(findTestObject('Object Repository/Page_MEDICALHUB Sales/button_SAVE')) //here I am saving
WebUI.check(???????) //here I want to select checkbox to edit
WebUI.click(findTestObject('Object Repository/Page_MEDICALHUB Sales/i_Sales_fa fa-pencil'))
checkbox is not checked

before try to check
Use this:
WebUI.waitForElementPresent(findTestObject('checkobx'), waitTime)

Since you have to wait for the element to be rendered, you will need to wait not only for it to be present (present in DOM) but also clickable:
WebUI.waitForElementClickable(findTestObject('Object Repository/checkbox element'), 30)
More info on Katalon Docs page.

Related

I'm using sap.m.Wizard. But the number of steps aren't dynamically rendered

I'm trying to create a wizard using sap.m.wizard in which the number of steps can be dynamically rendered.
I'm unsure on how to proceed with this.
flow can be:
1-2-3-4-5
1-3-4-5
1-2-4-5
1-3-5
Problem I'm facing:
When we create the wizard dynamically,
if we click on item with 5 steps .. OKAY
Then we click on item with 7 steps .. OKAY
Then we click on item with 6 steps .. ERROR
"dynamic step removal not yet supported"
You can do like this
wizard.removeAllSteps();
wizard.addStep(step1);
wizard.addStep(step2);
wizard.addStep(step3);
wizard.addStep(step4);
wizard.discardProgress(wizard.getSteps()[0]);
You can choose which step you want to add in which order. This will work for you.

How to read from an already existing dropdown list and click on OK button using autohotkey?

ControlGet List,List,,DropDownList, Installer Language,English
Control,Choose,1,ComboBox,DropDown
This is the snippet which I am using to read from the dropdownlist and it is not working. Please tell me what is the right snippet to be use here.
Thanks
I'm not sure what you are trying here. This code is something similar to what you require...
Gui, Add, DDL, %chooseMonth% vMonthSelected,January||February|March|April|May|June|July|August|September|October|November|December
It allows you to select Month from the drop down list and stores the selected value in variable chooseMonth

refresh vb6 form in background without losing user entered data

I'm working with some old VB6 code and have a scenario I'm trying to correct. I have a form that allows you to enter a person ID (use renters this in a textbox at the top) and click "show" it lists the appointment in the textbox on the same form. There is also a button that loads a new form that allows the user to edit the displayed data and save the change.
E.g. Change persons age from 65 to 64. I make this change, and save it. The save is successful and I unload the form to return to Form1. However, I must click "show" again to refresh the displayed data in the textbox to ensure the change is visible. I cannot figure out how to refresh this form, so the user doesn't have to click "show" to repopulate the textbox with the new value. Can anyone assist? I can't just create a new instance of Form1, because if I did that the person ID field would be blank.
Thanks!
Short version: How do I refresh a form to get latest data while still obtaining the relevant person ID.
There's not enough information here to answer your question. The general pattern you'd use in this situation is as follows:
SearchForm launches ViewForm.
ViewForm launches EditForm. When ViewForm constructs its instance of EditForm, it passes Me to EditForm (perhaps by setting EditForm.Parent).
When EditForm's Save button click event fires, it calls Parent.ReloadData (where Parent is the ViewForm that launched the EditForm).
Here is the approach that should work. In the editor have a public property that returns whether the form was cancelled or not. (.Cancelled). You'll have an object that carries attributes of the person that you are trying to change the age of. Then it's pretty simple. Code in the main form:
dim oPerson as clsPerson
dim oFrm as frmAgeEditor
set oPerson = GetCurrentPerson()
set oFrm = new frmAgeEditor
with oFrm
set .Person = oPerson
.Show vbModal
if not .Cancelled then
' Update Main form with the contents of oPerson
end if
end with
You can just call in "Show" function right after updating.
Call Me.frmParent.Refresh
I used this to refresh the screen without losing data.
I had to dig through a lot of old code to figure it out. This section had been written a long time ago, and worked well.
Public Sub Refresh()
Call cmdDetails_Click
If tvwScreeningSchedule.Nodes.Count > 0 Then
tvwScreeningSchedule.SelectedItem = tvwScreeningSchedule.Nodes(1)
Call tvwScreeningSchedule_Click
End If
End Sub
It's quite a specific function, and "cmdDetails_Click" contains alot of custom validation, but it's not too dis-similar to AngryHackers answer.

TYPO3 Extension Manager: Button "Only display updatable extensions" is not displayed

If I open the extension manager, switch to the tab Import Extensions and select the filter I get the following options:
Display all extensions (empty)
Only display installed extensions (working)
There should also be a Only display updatable extensions selection but this isn't displayed. What is the reason therefore?
I made a TYPO3 update to 4.7.2 and perhaps thats the reason why it isn't correctly displayed?
The repository is up to date.
The filter has been moved from the Import Extensions to the Available Extensions tab.
You do not actually want to import an extension, but update an existing one.
Just suggestion: I had similar issues with button displaying in EM before (4.6.x) (ie. Install ext button) and realised, that the button is available, but sprite image had wrong position which caused that the button was transparent,
Try to use ie FireBug to check it, and eventually fix the CSS (and report the bug)
Edit:
Some doom apparently, I just had identical situation just seconds ago ;) Fortunately found the reason: the ext list is displayed with ExtJS grid, which can contain custom filtering per column. Literally: when you for an example click on the column's dropdown arrow, you can in its filter set some value to narrow the search results.
Ie.: in the main filter field write news and additionally in the Extension Key column set other filter tt_news. (if you want to display only %tt_news% in result list of %news%)
In that case even if you'll clear the main filter, the one set on the column will stay active, so next time when you'll try to search for realurl in main filter, it will return empty list as Extension Key filter is still set to tt_news.
Weeeird, however helped me :)
You can recognize filtered columns as their names are written with cursive, finally you can just check every column and disable any filtering on each.

ExtJS 4 - How to load grid store with its params carrying latest values from a form?

I have a window with a search form at the top and grid at the bottom.
User can enter values in the search form and click button - Get Records.
At the click of this button, I load the store of the grid by passing the values in form fields as parameters in following way:
store.load({
params:{
key1:Ext.getCmp('field1').getValue();
}
});
I tried giving parameters in the store proxy itself, but it unfortunately always takes up initial values (values when the form is rendered) and not the latest one entered by the users in the form fields. Following is the method I used for assigning values to params while creating the store:
extraParams:{
key1:Ext.getCmp('field1').getValue();
}
I wanted to seek guidance at two things:
a. While defining a store, can I ensure that store takes latest/current values from the form fields before querying server, so that I don't have to provide these values while calling load function?
This becomes more necessary as I have a paging toolbar at the bottom which carries a refresh button (along with next, last, previous, first icons for navigation).
Now, whenever user clicks at refresh (or any navigation icon), the store gets loaded without the query parameters.
Thus the second thing is:
b. If the answer of 'a' is that - Pass the latest values to parameters manually when calling load function - then how can I write the handler for 'refresh' button and navigation icons (that is, next, last, previous and first) in the paging toolbar, so that I can pass the latest form values to load function.
Thanks for any help in advance.
PS: I am using ExtJS 4.
yourStore.on('beforeload',function(store, operation,eOpts){
operation.params={
status:cmbStatus.getValue(),
value:txtBuscarPor.getValue(),
empresa:'saasd',
app:'dsads'
};
},this);
Related to your question (b) (and because you especially asked for this in the comments section):
I see only one standard way to hook into the PagingToolbar button handlers which is very limited.
Ext.toolbar.Paging fires a 'beforechange' event before it actually changes the current page. See API docs. A listener that returns false will stop the page change.
All other methods require extending Ext classes which wouldn't be a problem if the ComboBox would make it easier to use your own implementation of BoundList (which is the class that renders the dropdown) or pass through config parameters to BoundList resp. the paging toolbar.
I tried to bring this lack of flexibility up on the Ext message board once but was pretty much ignored.
A possible solution for this is to use 'beforeload' event of the store and provide the list of parameters in it. This way, whenever the store is loaded, then its beforeload event is fired and the values picked up are always the latest. Hope this helps someone looking for something similar.