To Execute multiple Test fragment gradually using multiple module controller in Single thread group - testing

I want to execute multiple Test fragment one by one in single thread group for that I have created multiple test fragment and for each Test fragment I have separate module controller that I am selecting using switch controller, but while executing a test entire thread group duration is getting consumed in one module controller. Others module controllers are not getting window. PFA Jmeter elements structure.
enter image description here

I cannot reproduce your issue using simplified version of test plan:
so my expectation is that something is wrong with your ForEach Controller and/or Switch Controller.
Given the nature of the Ultimate Thread Group I don't think you need to have these 2 guys at all (unless there is a custom complex selection logic which I'm not aware of)
If you need further assistance you need to show
ForEach Controller and Switch Controller configuration
Schematic view of your Test Plan (Tools -> Generate Schematic View)
The values of JMeter Variables used in the ForEach and Switch Controllers for at least 2 iterations (can be obtained using Debug Sampler and View Results Tree listener combination)
jmeter.log file

Related

Javafx dynamically fxml load at Runtime

I have an application that cover a wide number of use cases each with completely independent workflows but workflows are pretty static after installation.
I have therefore created an HBox placeholder that will load the workflow for an installation.
Is there a way to dynamically load a section of the fxml from a database or a separate file archive? This fpml will have to have its own set of images and resources needed to achieve the workflows functionality.
TBH, I don't know where to start on this one.
Regards
I do not quite understand your problem. You can modify the scene graph at any time you want. So, of course it is possible to load a part of the scene graph from an FXML file at any time and hook it up to the already existing part. In your controller you have access to your HBox placeholder and when you have loaded the second part of the scene graph you can just add it via hbox.getChildren().add(newpart), were newpart is the root node of your second scene graph part. Of course you have to make sure that the layout works correctly for your constellation.
Your question seems nonsense because the FXML is always loaded dynamically. My guess is you are confused because most of the examples use FXML in the same bundle as the classes and so are loaded trough the getResource method. But the FXML loader takes any kind of InputStream, so you can just open a database blob or a file as an InputStream and give that InputStream as an argument to the loader. Be sure to catch the runtime exceptions though :)
Hope this helps.

Safari Extension multiple start script inclusion

I am building a simple Safari extension and sometimes the start script start.js specified is never included ans sometimes it is included many times like so :
Has it ever happened to you ?
This is probably due to iframes. The injected script is loaded in every iframe in the current tab. I don't think you can stop the script itself loading, but you can use if (window == window.top) within the script to ensure that code is only executed in the main page, not the contained iframes.

EventToCommand binding with parameters in portable view models

I am implementing a view model that is shared by applications on multiple platforms. I am using MvvmCross v3 that has its own MvxEventToCommand class, but I believe the challenge is the same for other frameworks like MVVM Light. As long as the event is used without parameters, the implementation is straightworward, and this is the case for simple interactions like tapping the control.
But when the command needs to handle event arguments things become more complicated. For example, the view model needs to act on certain scroll bar changes (and load more items in the associated list view). Here is the example of XAML:
<cmd:EventToCommand
Command="{Binding ScrollChanged}"
CommandParameter="{Binding EventArgs}" />
(MvvmCross uses MvxEventToCommand, but the principle is the same).
Then in my model I can have the following command handler:
public ICommand ScrollChanged
{
get
{
return new RelayCommand<ScrollChangedEventArgs>(e =>
{
MessageBox.Show("Change!");
});
}
}
(MvxCommand in MvvmCross).
The problem is that ScrollChangedEventArgs is platform specific and this code simply will not compile in a portable class library. This is a general problem with any command that needs not only a push when an event was fired but requires more specific event details. Moving this code in platform-specific part is silly because it more or less kills the concept of portable view models and code-behind-free views. I tried to search for projects that share view models between different platforms, but they all use simple events like "Tap" with no attached event details.
UPDATE 1 I agree with Stuart's remark that view models should only deal with higher level abstractions, so I will rephrase the original concern: how to map results of low-level interactions to a platform-neutral event that triggers a business logic command? Consider the example above: the business logic command is "load more items in a list", i.e. we deal with a list virtualization where a limited number of items from a large collection are loaded initially, and scrolling down to a bottom of a list should cause additional items to be loaded.
WinRT can take care of list virtualization by using observable collections that support ISupportIncrementalLoading interface. The runtime detects this capability and automatically requests extra items from a respective service when the user scrolls down the list. On other platforms this feature should be implemented manually and I can't find any other way than reacting on ScrollViewer ScrollChanged event. I can see then two further options:
Place OnScrollChanged handler in a code-behind file and call the portable view model higher level event (such as "OnItemsRequested");
Avoid code-behind stuff and struggle to wire the ScrollChanged event directly to a view model, then we will need to remap the platform-specific event first.
As long as there is no support for second option, putting event handler in code-behind file is OK as long as it is done for the sole purpose of event mapping. But I would like to investigate what can be done using the second option. MvvmCross has MapCommandParameter class which seems to be able to help, so I wonder if I should exploit that one.
UPDATE 2 I tried MapCommandParameter approach, and it worked allowing me to insert a platform-specific adapter that would map low-level events to view model-specific commands. So the second option worked without any struggle. Stuart also suggested listview-subclassing so there is no need to care about scrolling events. I plan to play with it later.
I agree that viewmodel commands should normally be expressed in terms of viewmodel concepts - so it would be 'strange' to send the viewmodel a command about the scrollbar value changing, but it might be ok to send the viewmodel a command about the user selecting certain list elements to be visible (which she does via scrolling)
One example where I've done this type of thing previously is in list selection.
I originally did this across multiple platforms using a cross-platform eventargs object -
https://github.com/slodge/MvvmCross/blob/vnext/Cirrious/Cirrious.MvvmCross/Commands/MvxSimpleSelectionChangedEventArgs.cs
this was then used on WindowsPhone (for example) via an EventToCommand class like https://github.com/slodge/MvvmCross/blob/vnext/Cirrious/Cirrious.MvvmCross.WindowsPhone/Commands/MvxSelectionChangedEventToCommand.cs
However... I have to admit that this code hasn't been used much... For list selection we have instead mainly used selecteditem binding, and there simply haven't been any apps that have needed more complex parameterized commands (so far) - you might even need to go back to very old v1 mvvmcross code to find any samples that use it.

Testing an activity 4 clicks deep using Robotium

I have a home activity ActivityA, which has button that creates an intent, sets up some Extras and calls ActivityB. This in turn calls ActivityC , and in turn calls ActivityD.
I don't want to have to write a test case that opens ActivityA and proceeds to drill through 4 activities to get to the one I want to test. How can I set up the Extras required by ActivityD when it launches to prevent errors in my code. For example before I call the intent that launches activityD it sets up an Extra which ActivityD then uses.
Thanks
Robotium gives you an option to launch an activity with a given intent, you will need to determine the intent that you need in order to launch the activity correctly. If you look in logcat it might give you the details that you need to launch the activity correctly. If you are unsure what to look for post the logcat logs of the time between clicking the element on Activity C and Activity D launching and i can try to look for you.

Switching Modules in Composite Application Block

I am new to CAB framework. After going through the sample GPS application I understood how a single module is loaded and its view is displayed.
I have a project in which I have 3 forms. Should I create a single module with three different Views for this or should I create three different modules for this.
If I create three views, how do i Switch between these views. And if I am creating three different Modules, how do i switch between these modules.
thanks.
If you will always use these three forms together, put them in the same module. If you will need only one or two of these forms at a given time, put them in separate modules, so you can load only the forms you need on demand.
I don't understand what you exactly mean by "switch between modules". If you refer to how you select which modules to load at the application start, you do it by overriding the GetModuleCatalog method in the bootstrapper and creating a module catalog inside the overrided method. If you mean how to load modules dinamically at any point in the application, you can do that by using the LoadModule method in the container's IModuleManager object.