The only global custom text on Gatling report is Simulation class name. It appears in the upper right corner of the report.
How can I put some custom message (short) without changing the name of the Simulation class?
As far as I know there are 3 ways of put some custom message to Gatling report
Run description param inside gatling.conf file, it is displayed at top part of report (next to report time and duration)
gatling {
core {
runDescription = "Test description of report"
}
}
Scenario name - param of scenario in your test code, displayed on one of reports (Active Users along the Simulation)
scenario("Scenario name")
.exec(http("Action name").get("http://localhost"))
Action name - param of http in your test code, displayed on Statistic table
scenario("Scenario name")
.exec(http("Action name").get("http://localhost"))
Related
Inside our active directory we have a property named "Employee ID" as follow:-
so inside our PowerApp form i want to get the value of this property,,, but i checked the Office365Users connector # https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-users seems it does not provide such a data.. so how i can get the Employee ID property inside our PowerApp form? this ID is different than the ID which we can get using this formula Office365Users.MyProfile().Id which will return the internal GUID of the user, and not the number shown above.
Thanks in advance for any help.
Currently (As of 2021-09-27), there is no Out of the box connector for Power Apps that will get you employeeId. The reason is that we need to query the beta version of Microsoft Graph, as it is not query-able in the version 1.0 of the endpoint. There is hope, the new Office 365 Users Connector has a new version of Get my profile (V2) that queries the new version of the Graph interface, and allows us to select employeeId, as well as almost everything else available. The downside is that it returns a GraphUser_V1 object. So, even though the API call returns the employeeId, since Power Apps is Strongly Typed, we cannot reference employeeId as it's not a part of the GraphUser_V1 object.
Power Apps may not be able to pull the value, but Power Automate can. As a POC to get you started:
In Power Apps, create a button with the Action being running a Power Automate Flow.
Create a new flow "Power Apps button" called "GetEmployeeId".
In Power Automate, create a new step: Get my profile (V2).
Under advanced options set Select fields to employeeId
Create a new step: Parse JSON
Set Content to the body of Get my profile (V2):
#{outputs('Get_my_profile_(V2)')?['body']}
Set Schema to:
{
"type": "object",
"properties": {
"##odata.context": {
"type": "string"
},
"##odata.id": {
"type": "string"
},
"employeeId": {
"type": "string"
}
}
}
Create a new step: Respond to a PowerApp or flow
Add an output type Text:
Enter title : EmployeeId
Enter in a value to respond : #body('Parse_JSON')?['employeeId']
Save the Power Automate flow and test it. You will have to approve O365 access permissions. The whole flow should look like this:
Back in Power Apps, Connect your new flow to the app.
Set your Button1.OnSelect to: Set( varEmployeeID, GetEmployeeId.Run())
Create a label with the Label1.Text set to: varEmployeeID.employeeid
Run the app and click the button to test.
I think your scenario requires to use Microsoft Graph to consumes Azure AD User Account objects, that inherits from directoryObject. About this item, recommended to view similar trouble in this topic: Get EmployeeID on Powerapps, that contains an example to parse in parameter an e-mail or an UserPrincipalName and returns the Active Directory employee ID.
How to run specific scenario in cucumber out of multiple scenario?
Feature file
Feature: Test Test Smoke scenario
Scenario: Test login with valid credentials
Given open firefox and start application
jhbhhjhj
When I click on Login
And enter valid "kumar.rakesh#yopmail.com" and valid "admin#123"
Then Click on login and User should be able to login successfully
Scenario: Test shop for cart
Given Click on shop for carts
And select plates
When Click on Add to cart
Then product should be added in the cart successfully
And verify the product
Scenario: Test login with valid credentials1
Given open firefox and start application
When I click on Login
And enter valid "kumar.rakesh#yopmail.com" and valid "admin#123"
Then Click on login and User should be able to login successfully
Scenario: Test shop for cart1
Given Click on shop for carts
And select plates
When Click on Add to cart
Then product should be added in the cart successfully
And verify the product
Test Runner
package runner;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#Cucumber.Options(features="features",glue={"steps"},format = {"pretty", "html:target/Destination"})
public class TestRunnr {
}
Use tags future in the cucumber like below.
Feature: Test Milacron Smoke scenario
#Test1
Scenario: Test login with valid credentials
Given open firefox and start application
When I click on Login
And enter valid "kumar.rakesh#thoughtfocus.com" and valid "Thought#123"
Then Click on login and User should be able to login successfully
#Test2
Scenario: Test shop for cart
Given Click on shop for carts
And select plates
When Click on Add to cart
Then product should be added in the cart successfully
And verify the product
#Test3
Scenario: Test login with valid credentials1
Given open firefox and start application
When I click on Login
And enter valid "kumar.rakesh#thoughtfocus.com" and valid "Thought#123"
Then Click on login and User should be able to login successfully
#Test4
Scenario: Test shop for cart1
Given Click on shop for carts
And select plates
When Click on Add to cart
Then product should be added in the cart successfully
And verify the product
If you want to run only Test1 scenario update runner file like below.
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(features="features",glue={"steps"},format = {"pretty", "html:target/Destination"},tags={"#Test1"})
public class TestRunner {
}
If you want to execute multiple scenarios keep comma sepearated tags as mentioned below.
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(features="features",glue={"steps"},format = {"pretty", "html:target/Destination"},tags={"#Test1,#Test2"})
public class TestRunner {
}
Like the other answers suggest, use tags. If you use maven, you don't have to change the runner file - just add this to your maven call
-Dcucumber.options="--tags #Test1"
The thing I like about this method is that I don't risk committing the tags in the runner file.
Also, here is an example on running multiple tags in maven.
You can either use selective feature file or selective scenarios in the feature using tags. Please try with this solution.
Lets consider the you have n number of feature files and you need to run only selective feature from that. Then name each feature file with #tag name.
eg.: Under this folder, if you are having n number of features - "src/main/resources/publish"
1st Feature file name:
Login.feature
//Inside the file start with feature tag name
#Login
Feature: To Login to Email
//Then feature name followed with scenario tag name
#User1
#Scenario1:
Scenario Outline: Navigate and logon to gmail application
Given User launches gmail application
When User updates emailID <emailID>
And User updates pwd <pwd>
Then User clicks on Login Button
Examples:
| emailID | pwd |
| a#gmail.com| 123 |
#User2
#Scenario2:
Scenario Outline: Navigate and logon to facebook application
//Write the code for scenario 2 as similar to above
2nd Feature File name:
CreateEmail.feature
#Createmail
Feature: Create email
Scenario: Blah blah blah...
//Write all Given when And Then
3rd Feature File name:
SendEmail.feature
#Sendemail
Feature: Send email
Scenario: Blah blah blah...
//Write all Given when And Then
So From the above Test files. Lets consider you want to test 1st and 3rd feature alone, Then you can use code as below:
eg.:
//This is to run specific feature files, which is 1 and 3. Likewise you can use the tags for scenario as well if you have n number scenario in same feature file.
#CucumberOptions(features= "src/main/resources/publish", tags="#Login, #Sendemail", format = {"pretty"} )
// This is to run specific scenario in the feature file. If you have multiple scenario, then you can write your specify your scenario tags followed by comma.
#CucumberOptions(features= "src/main/resources/publish/Login.feature", tags="#User2", format = {"pretty"} )
You need to use tags to filter out the scenario. Put the tag on the feature file and add this to the cucumberoptions of the runner.
#RunScenarioExample
Scenario: Test login with valid credential
#Cucumber.Options(features="features",glue={"steps"},format = {"pretty", "html:target/Destination"}, tags={"#RunScenarioExample"})
Currently we are re-running the test when a Test Fails using TestNG iRetryAnalyzer.
Problem that we are facing is:
We have a Test to 'Add a user'. For the first time after adding a user, in the process of checking the success message exception occurred (Timeout/NosuchElement) etc But the user is added in the database.
Now again when we re-run the test with same data, the Test Fails as user is already Added.
How can i overcome this??
As here the Data, the user email id unique field. Atleast I should be able to change the Email Id when im re-running it for the second time.
Please help me.
If you just need to create a unique, fake email address that you don't need to actually use, you can always append a date/time stamp to some base email you get from your DataProvider:
#Test(dataProvider = "dp")
public void emailTest(String userName, String emailShortname) {
//Get the current time
long time = System.currentTimeMillis();
//append it to the email from your DataProvider
StringBuilder emailBuilder= new StringBuilder();
emailBuilder.append(emailShortname).append("_").append(time).append("#gmail.com");
//do user creation code below using emailBuilder result...
I would say that if you are going to do these sorts of tests using Selenium, you're going to fill up your database with junk test IDs, so I'd suggest your team create a mechanism to clean these out either as part of the test run or after it.
Ideally, if there is a way to delete a user. You should use that in the #aftertest method and remove that user.
This way the next time you will be again able to use the same email id irrespective of the test is successful or not.
If not and if the email id is never verified ( I mean like some confirmation email which you use to confirm the user) you can create fake email id on the fly like xyz123#gmail.com. If the email id is verified then i guess you are in trouble.
Iam using Vtypes for Changpassword window.
My requirment is need to use only vtypes for all required/validations fields
So with out enter data clik on save its shows bubbles for required fields,but also show vtype for oldpassword not match.So how can use vtype after hitting database(From server) So is it possible?How
please provide some idea
Thanks in advance
You cannot use Ext.form.VTypes on the server unless you use some sort of JavaScript server (node.js with an ExtJS adapter - if there is one). You didn't mention the programming language you use on the server, so the answer is quite generic. To return errors from form posts that will be displayed as form field errors, your response to the form submit must conform to the following format:
{
success: false,
errors: {
oldpassword: "Your current password does not match"
}
}
The important part is the errors-structure. It contains key-value-pairs with the key being the name of the form field you'd like to display the error on and the value being the error message that will be displayed.
I need to extract attatchments out of salesforce? I need to transfer some notes and attachments into another environmant. I am able to extract the notes but not sure how to go about extracting the attatchments
Thanks
Prady
This mostly depends on what tools/utilities you use to extract. The SOQL for Attachment sObject will always return one row at a time if Body field is included in the query. This is enforced to conserver resources and prevent overbearing SOQL scripts.
Approach #1, if queryMore is not available: Issue a SOQL without Body field to enumerate all attachments, then issue one SOQL per attachment ID to retrieve Body
Approach #2: Issue a SOQL to retrieve all needed attachments then loop using queryMore to get them one at a time.
Approach #3: If you can "freeze" the SF environment and just want to take snapshot of the system to pre-load a different one to be used going forward you can use "data exports". In setup menu, in data management there is an export data command, make sure you click "Include in export" to include all binary data. After due process it will give you a complete data backup you can crunch offline.
Btw, body is base64 encoded, you'll need to decode it to get the actual binary
Here is the solution I've used to get the attachment binary content from SalesForce. The example in their documentation points the following:
curl
https://na1.salesforce.com/services/data/v20.0/sobjects/Document/015D0000000NdJOIA0/body
-H "Authorization: Bearer token"
So there are a couple different elements here. The host (https://na1.salesforce.com) you should be able to get after the login process, this host is session based so it can always change. Second element is the rest of the URL, that you will get from the "body" field of the Attachment object. Third and last element is the Authorization header, which is composed by the string "Bearer ", plus the token that is given to you after you authenticate with the SF backend.
The response is the binary file, it is NOT in base64, just save it to a file and you are good to go.
Here is an example of how I did it in Objective C:
// How to get the correct host, since that is configured after the login.
NSURL * host = [[[[SFRestAPI sharedInstance] coordinator] credentials] instanceUrl];
// The field Body contains the partial URL to get the file content
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"%#%#", [host absoluteString], {AttachmentObject}.body]];
// Creating the Authorization header. Important to add the "Bearer " before the token
NSString *authHeader = [NSString stringWithFormat:#"Bearer %#",[[[[SFRestAPI sharedInstance] coordinator] credentials] accessToken]];
NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0];
[urlRequest addValue:authHeader forHTTPHeaderField:#"Authorization"];
[urlRequest setHTTPMethod:#"GET"];
urlConnection = [NSURLConnection connectionWithRequest:urlRequest delegate:self];
Hope it helps.
You can use SOQl Query options, or if you are looking for some automation tool that will help you with quick export, then you can try AppExchange App Satrang Mass File Download - https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EcsAOUAZ&tab=e
Disclaimer: I work at Satrang Technologies, the publisher of this Mass File Download AppExchange App.
In SalesForce attachment will be against an Object for e.g. Account object.
Steps to retrieve attachment (in Java)
Get the ID of the Object to which a file is attached. e.q. Account Object
String pid = Account__r().getId();
Execute a Query on Salesforce Object "Attachment" for the ID in Step 1
*String q = "Select Name, Body, ContentType from Attachment
where ParentId = '" + pid + "'";
QueryResult qr = connection.query(q);
SObject[] sarr = qr.getRecords();*
SObject so = sarr[0];
Typecast Salesforce Generic Object (SObject) to "Attachment" object
*Attachment att = (Attachment)so;*
Retrieve the Byte Array Stream from Body of Attachment, and do the operation needed on byte array.
*byte[] bName = att.getBody();
// Do your operation in byte array stream*