Create a non legacy Event - social-tables

When I use the legacy API call to create an event all works as expected except it is displayed in the Web UI with a 'View Diagrams' and 'View Guest Lists' buttons.
After creating an event using the web app it just displays a 'View Event' button and postfixes the description with '[V2]' The display url is of the form: https://app.socialtables.com/?event=435008 which seems to be using the legacy_id of the event.
I need to be able to create an event that matches the behavior of the Web App.
How can this be accomplished?

The legacy API is intended to create Legacy Events, so that is working as it should. We are in transition from our legacy to 4.0 apis so the following will solution will work today with minimal changes to your code: setting venue_mapper_version as 3 in the legacy API call.
{
...
"venue_mapper_version": 3
}
To ensure future-proof functionality you should also consider using our /4.0/events routes as they will be the answer going forward. https://developer.socialtables.com/api-console#/Events

Related

Problem of Jmeter/Webdriver with testing a webapp searching data form which has Knockout installed

I am facing problem of testing jmeter/Webdriver for a webapp which has Knockout framework installed. I fill all the form fields OK but when run click search button it displays the error that required fields need not to be empty. I checked all web element value are not empty. As my understand Knockout is not activated to bind Web elements with DataModel from Knockout. I used wait WDS.browser.manage().timeouts().implicitlyWait for webpage fully loaded/ajax calling or event being fired but without any success. I Do you have any experiencing and solution for testing this kinds of webapp?
thanks
It might be the case you need to trigger a certain JavaScript event in order to "tell" the web application that you finish the input, i.e. onkeyup or onblur which is not being automatically called by Selenium's sendKeys() function
You can use i.e. WDS.browser.executeScript() function to send the event(s) which indicate that you filled in the form(s). Check out The WebDriver Sampler: Your Top 10 Questions Answered article to learn how to call scripts, use Waits, etc.

TextBox does not have KeyDown or KeyPress events

I have a visual basic web application and i placed a textbox on the form. When I look at the actions available for that textbox, the only actions available are DataBinding, Disposed, Init, Load, PreRender, TextChanged, and Unload. Why is KeyDown not available? Is it because this is a web application as opposed to a windows application? Is it possible to build an event handler that will fire the when a key is pressed? Maybe I have to convert my project to a windows application?
Yes, that is the reason. Remember that, in a web application, functionality is split between server and client. If you want to react to keystrokes then you need to do that on the client side, which means using JavaScript.
You are using Asp.Net Web Forms application. The very reason it exists is to help developers who previously worked on WinForms applications to move towards Web Development. This is why there are some similarities, e.g. WinControls <-> WebControls. But don't forget, you are in the WEB now. Your Button_onClick event works completely differently. If on WinForms this is invoked directly by button press; on the WebForms, your form is translated into HTML page with <form> and <input . . .> tags. And it builds javascript automatically, so when you press the button, there is a POST call to a server. Then, your server receives request, and directs execution to Button_onClick during so-called "page cycle".
Once you decide that your app needs to be a web app, you should probably forget doing it using Web Forms because this system is not true web development. A true web-centric development would be Javascript-based UI, may be using some framework like Vue or Angular with Asp.net Web Api as server app. May be you should start with Asp.net MVC. This will make you concentrate on single application, because server and client components are developed together when you use MVC.
Going back to main question - yes, 2 different systems, do not expect compatibility. And even when something seem similar, they might behave differently.
Why do you want to capture the keystroke?
You can control that the TextBox is entered by code, for example, that only numbers are entered;
asp:TextBox ID="TextBox3" runat="server" Width="50px"
AutoComplete="off" MaxLength="20" type="number" step="any"
TabIndex="9">

WKWebView - replace web action

Inside my app, I'm using the WKWebView to display a website. My goal is, when user is pressing a button on this website, I want to stop an action linked to this event and replace it with my own, natively made (custom action outside the WKWebView). I've been trying to search for any solution to fetch mentioned event but unsuccessful. What more came to my mind, if there is a way to fetch a JavaScript in WKWebView, I have a possibility to add some JS script code to this site (not to delete the action I want to block). Thank you for any help.
First, do you have a permission to mess with this web site's behaviour? I assume you do, otherwise it is likely illegal.
Second, try using Safari Web Inspector with a device/simulator, and use the DOM tree and console tools to find out what is the HTML/javascript that is involved with this action on this site.
If you can't find what happens in HTML/JS yourself, feel free to post a new separate question on SO with your target URL, some HTML/JS code, and which link/action you want to replace. Tag the question with "javascript" and ask if it is possible to write some javascript to replace that particular action to some custom JS code.
Usually there are 2 types of actions: either it is something that provokes AJAX calls to a server API triggered by an event handler, or it is a plain HTML link that results in a web navigation. For both cases it is possible to write a JS script that overrides the action.
Finally, use WKUserScript to inject javascript into the page, and override the action. Use window.webkit.messageHandlers to send an event from your custom action to the app side. Use WKScriptMessageHandler to process the event in the Objective-C or Swift code.
See an example here: http://nshipster.com/wkwebkit/

How to use/handle a loader in an MVC app?

in a ASP.NET MVC application that I am currently working there are multiple places in a single page that the user can click. So there is a main menu that's in _layout and for each inidividual page there can be links associated with that page.
I am trying to use a loader which will be shown on every click, mainly where the response takes time but for now it's for every click.
For example in the home page, from the main menu the user can click Students and the loader should come up and hide when the page loads completely. On the students page there can be an ajax call that gets data and binds it to the grid.
So from the time the user clicks on a menu link and the page loads the loader is active/shown. It's hidden once the page loads completely.
The grid can have editing functionality and when the user clicks on any of the CRUD links the loader should show and hide.
I am looking at suggestions on implementing this requirement.
If I can hookup any of the MVC events, that would be cool as I want less of Javascript/jQuery stuff but if Javascript/jQuery is the way then that's fine too.
Currently I don't have anything so anypointers are appreciated.
Assuming AJAX is being used
I don't see a way to keep this server-side without a middle page with a redirect being used (which would just be unnecessary bloat). And, since you're not opposed, you can implement this fairly easily using jQuery and something like blockUI.
I'll let you play with refining the binding to only links you care about, but for now we'll assume all links. Also, MVC should be using jQuery for things like Ajax.Actionlink so we can hijack events like $.ajaxStart and $.ajaxStop:
function showLoadingScreen(enabled){
return enabled ? $.blockUI() : $.unblockUI();
}
$(document).ajaxStart(function(){
showLoadingScreen(true);
}).ajaxStop(function(){
showLoadingScreen(false);
});
Later on you can maybe apply classes to the links you care about and just bind to them (instead of $.ajaxStart) but I'll leave that up to you.

Best way to create user notifications on webpage in ASP.NET MVC 4 Razor

tl:dr -> User notification system on website. Can you avoid the need to call a javascript script to render notifications after ajax loads? (a base view that calls it would work, but there are no base views afaik)
I am looking for a way to add a User Notification System to my website. Such system would be responsible for displaying messages like 'Import success', 'Import failed', 'Session timed out' etc.
I know similar questions have been answered before, but here's my question:
How should I do it to get as close as possible to having the notifications display themselves as soon as possible after being put to TempData? Having them rendered on _layout page would work, but only for requests that ask for whole page. What about loading only parts of website through ajax -> can I avoid having to write JS script in ajax callbacks or partial views?
I am looking for something to prevent writing multiple calls to same function.
Toastr is your notification Friend. Demo Page
you can install it from Nuget Install-Package toastr
See my SO question - for reference