Visual Studio: Use csv file for "Find Text" validation in web performance test - visual-studio

I can use csv files to enter data into input field after a test is recorded. I was wondering if csv file could be used for "Find Text" validation field. I don't see options to add csv file so I have directly hardcode text be checked. If I could add a csv file then I would just need to change the csv file once the website texts are changed. Could this be done by using codedUI test?
Thank you

The fields of a data source can be used in many places within a Web Performance Test. There are two main ways.
In the properties panel for the call of the validation rule, click in the value field for the required property. You should get a box allowing the data source field to be chosen.
Alternatively enter text similar to the following into the field
{{DataSource1.YourFileName#csv.FieldName}}
Note the doubled curly braces {{ and }} around the full data source string. You can also add extra text to this sort of entry, eg
Some text{{DataSource1.YourFileName#csv.FieldName}}and even more text

Related

Xcode: How to find something only in specific file type?

In Android Studio, I could search something in certain file type using the File mask as shown below. e.g. I could search on Kotlin (*.kt) files only
In Xcode, is it possible to do so as well? E.g. I would like to search only on the Swift file (*.swift). I don't see any filter as shown below, other than Ignore/Matching Case
Below the search field, there's an icon with three dots and a line above and below. In the default case, "In Workspace" is printed next to it.
Click this icon/text and a list of scopes is shown. Click the "+ New Scopeā€¦".
You can define complex rules for your scope, but in your case you would just need one: select File extension in the attribute field, is equal to in the condition field and swift in the value field.
You can give your scope a name and save it if you need it often.
But there is also a second solution: just do your search. At the very bottom of the search panel you see a circle icon with three lines, similar to the "ground" symbol used in electrics (IMHO); next to it is a text field with placeholder "Filter". Enter *.swift here to filter the search results for hits in Swift files.
An alternative way and arguably quicker way to do it is to just type the extension in the filter section below the list of matches.

Select yaml with drop down

I'm using Github pages to build some pages with text I want to get from yaml files. At present I have two yaml files one each for a different car type. I want to use a drop down in the header to select a car type which will then inform which yaml file to get to repopulate the page with text specific to that car.
I can create the drop down which adds a query string param to the page. I can also iterate through the two yaml files and output specific variables. What I can't figure out is how to use the two together so that the yaml file for the page is informed by the user selection from the dropdown.
Or maybe there is a much better way of doing this??
Github pages uses Jekyll, a static site generator. Your site is built once when you push to your gh-pages branch. After that, your browser is just served the generated HTML pages. All the iterating over your YAML files is done at generation time, not when you request the pages. Since you have no server-side code that is executed when you change your dropdown, you cannot process a query parameter.
Since you cannot process query parameters, you need to place your cars on different URLs. Here's a simple example how to change URLs with a <select> and JavaScript, using the code from this answer:
<select name="" onchange="javascript:location.href = this.value;">
<option value="/mypage/car1/" selected>Car1</option>
<option value="/mypage/car2/">Car2</option>
</select>
Then you just need to generate the HTML pages for each car, located at /mypage/car1/ and /mypage/car2/ respectively. That can be done by using your YAML data as part of the YAML front matter. For example, this could be car1.md:
---
layout: car
permalink: /mypage/car1/
data: # data of your car here
name: my very awesome car
---
Markdown content here (leave empty if you don't need it)
You then create the layout _layouts/car.html and in it, generate the appropriate HTML page. For example, to show the car's name, do something like:
<label>Name:</label> {{page.data.name}}
To avoid JavaScript, you can also create a dropdown menu containing <a> links with pure HTML+CSS.

Setup Project: user enters a value then store it in a text file or database

As the title said, how can i do that?
I've search some tuts on google, but only for creating simple setup projects.sample
When the user enters 'something', that value will be stored in a textfile or database after installation and is located in the application location (ProgramFiles). thank you ^_^
That dialog looks like a TextBoxes dialog, and that dialog has uppercase property names for the content. If it's TextBoxes(A) the property name is probably EDITA1 so you use it in the format [EDITA1] to pass it to custom actions. Without knowing exactly what kind of custom action you'll be using I can't be explicit, but you'll probably start by having [EDITA1] in the CustomActionData property of the custom action. For (a bad) example, in a VBScript custom action you'd use the value session.property ("CustomActionData").

Is it possible to change text directly in the code

I would like to know if there is a way to change text in the code instead of using the admin panel? I have Filezilla installed and can access my site/files from there.
If I use the inspect element in any browser, I can see an HTML structure, but as I have understood there is no HTML document in Magento, right? So where do I go if I want to make a change to a text element on my site and I don't want to use the admin panel?
Most of the text elements are handled by Magento's language translation system.
Quite often, you don't have to mess around hacking templates, just simply add a line to the translation CSV with the text string exactly as it appears, add a comma and then the new text string you want Magento to display.
For example, if you're working with US English, you can use the following file in your own custom template package as follows:
app/design/frontend/default/your_package/locale/en_US/translate.csv
Let's for example, change one of the window shade bar titles in the One Page Shopping Cart. Add a line to translate.csv as follows:
"Billing Information","Billing Address Information"
How this works, in the template the following line normally displays the title:
<?php echo $this->__('Billing Address') ?>
This code snippet $this->__('Billing Address') is a call to Magento's language translation system. It reads the translate.csv file finds Billing Address and changes it to Billing Address Information when it assembles the page html.
Lotta people out there have made changing text like this far harder than it has to be.
Hunting down the proper template, changing the text, finding the template got messed up, or trying to remember after the fact what was changed.
VS.
Changing a simple central file that contains all the text string translations... Often only by adding a new line to the file
Magento actually makes this very simple.
Thank you! So magento stores all text in .csv? or just the stuff that needs to be translated? I'm making a search for .csv via Filezilla but I only get two languages (the site is translated to multiple languages). Should I be looking somewhere else?

Knockout set initial value of an input field where html is allowed

I have two input fields first name and last name.
Application was running really well.
Suddenly someone came in from Mars and input something like this in those input fields
*(~'##~>?<+!""*%$)!
for both first name and last name. Now don't ask me why he did this cause in Mars this is very common. You can try it on this fiddle
http://jsfiddle.net/farrukhsubhani/3RjRF/
This text then went into my database and now when i retrieve it it came back like this
*(~'##~>?<+!""*%$)
which is ok for me as its html and I can place it back into knockout and it gets populated as html as you can see in fiddle above. However this Mars guy then thought that on Earth this is not a nice name to be with so he tried to edit field.
The above fiddle is kind of that edit page which shows him old value at bottom and two fields at top. He does not know html so he thought we have changed his name in input fields however I need to know
When passing text to knockout to give initial value to an input field is it possible to tell it that consider this text as html so it renders properly in input field
The other way around is to send him to http://www.w3schools.com/tags/ref_entities.asp and tell him about reserved HTML characters. This info has been stored in database (using Entity Framework simple person.fname and person.lname both with attribute AllowHTML) so on my fiddle i have just placed it in two variables and you can see how actual text boxes are different than html below. If i dont bind using Knockout then actual text is shown in these boxes and user can edit <>' signs without any problem.
Anyone with a solution before he leaves our planet. This can change alien life on our planet.
Update
If i go into this field and paste (~'##~>?<+!""*%$)" binding works fine and you can copy this and paste it into fiddle to see that. However its not taking that value from Javascript variable to knockout expects it to be a string and html special characters are not shown properly in input field.
We have done another test without Knockout and this text does get rendered within the field when you try to edit it its fine.
We have updated JSfiddle to work without JQuery and its the same result if you store it in a js variable and give not value to input field
http://jsfiddle.net/farrukhsubhani/3RjRF/3/
If we assign value to input field and just use jQuery to populate fullname then it works
http://jsfiddle.net/farrukhsubhani/3RjRF/4/
This last fiddle is a working example and we want Knockout to do what JQuery is doing.
I think the question then comes to how can this text be stored in javascript variable and placed into input field as html text so special characters appear unescaped. You can try unescape on jsfiddle that did not work for us.
Somewhere along the trip into (or maybe out of) your database, the value is being HTML-escaped. It's not Knockout itself that's doing it. You're going to need to track that location down, but you can't just disable it; you're going to have to replace it with something that sanitizes the result or otherwise you're opening yourself up to cross-site scripting attacks (any <script>s from external sources inserted into the input would have complete access to your data).
Any time you see the html: binding used, warning bells should go off in your head and you should VERY carefully to check to ensure that there's NO possibility of raw, unexamined user input making it into the string that gets displayed.
Ok here is what i did at the end
http://jsfiddle.net/farrukhsubhani/3RjRF/7/
I have done following:
I have added value attribute to input field and placed the input text as it came from server into it. Because I am using TextBoxFor in MVC it did that for me.
Before I apply knockout binding I have picked this value up using $('#kfname') and passed it to the actual binding so it used the value that came from server. Previously it was passed like (#Model.fname,#Model.lname)
I think what this did was allowed jQuery to pick up the value and assign it to binding instead of variable
ko.applyBindings(new ViewModel($("#kfname").val(), $("#klname").val()));
Hopefully this would help someone using knockout.

Resources