I need to verify the text in a multiline alert but I really cannot make it work.
The alert is like:
- Please enter firstname:
- Please enter lastname:
- ..............................
And I use:
verifyEquals("Verify msg",
ObjectHelp.closeAlertAndGetItsText(true),
"Please enter firstname:Please enter lastname:");
But it gives me FALSE for some reason!
I tried to debug and the alert text is really "Please enter firstname:Please enter lastname:" so, no doubts on that.
How can I manage multiline alerts?
I bet the actual text of the alert is not "Please enter firstname:Please enter lastname:".
It's more likely "Please enter firstname:\nPlease enter lastname:" (notice the \n).
You should confirm this in the page source, or the JS file containing the call.
Anyway, the right thing to assert here is
verifyEquals("Verify msg",
ObjectHelp.closeAlertAndGetItsText(true),
"Please enter firstname:\nPlease enter lastname:");
Related
Using Clarity for a work project and I'm unsure if the new clr-control-error messages work with reactive forms. The example they provide on using multiple error messages is with template forms, but the setup should essentially be the same.
Here is my code:
<clr-input-container>
<label>Password</label>
<input clrInput type="password" formControlName="password">
<clr-control-helper>8+ Character Password</clr-control-helper>
<clr-control-error *clrIfError="'required'">Please Enter Password</clr-control-error>
<clr-control-error *clrIfError="'minLength'">Password must be 8+ Characters</clr-control-error>
</clr-input-container>
newCompanyForm = new FormGroup({
email: new FormControl("", [Validators.required]),
password: new FormControl("", [Validators.required, Validators.minLength(8)]),
I'm using #clr/angular v0.12.4, angular 6.0.2, and rxjs 6.1.0. I can see the form is still invalid once I begin to type into the input field, but the error message never switches from "Please Enter Password" to "Password must be 8+ Characters". Once the password reaches 8 characters the field is no longer invalid so I'm pretty sure the Validator is working, just the error message is not showing.
It looks like maxLength and minLength are transformed into maxlength and minlength internally on the errors object. This should fix it below, though I will investigate this and double check it works in both reactive and template-driven forms.
<clr-control-error *clrIfError="'minlength'">
the Inputs Documentation says
Note: the validation only displays an error after the user has left
focus on an input. This is for better UX where the user doesn't see an
error while they are still typing.
This means by design you'll never see error messages while you're typing
I am building a Meteor application and am using the oaf:accounts-entry package to handle my user registration & authentication. I am working on the reset password function right now. However, when I click on "email reset password link", the application doesn't email me anything. Can someone help me or point me to instructions on how to configure the reset password function for the oaf:accounts-entry package? After doing a google search, I could not find instructions on how to configure it. The relevant packages I have installed are:
oaf:accounts-entry
accounts-password
email
Thank you!!
The password reset functionality should be working as it's provided by the package.
Have you properly configured your emails smtp settings and tested that your application is dispatching emails properly?
https://gentlenode.com/journal/meteor-3-smtp-configuration/5
NOTE: Using Meteor JS 1.6.1.1, package required are accounts-ui, accounts-password
To make forgot password link visible in the signup/sign in a widget, you need to do add little configuration in a file at location ROOT_FOLDER/client/main.js. The code is as below,
Accounts.ui.config({
passwordSignupFields: "USERNAME_AND_EMAIL"
});
If you do not choose passwordSignupFields: "USERNAME_AND_EMAIL" and choose something like passwordSignupFields: "USERNAME_ONLY", you won't be able to see forgot password option in the signup widget. (No one will tell you this, I discovered this weird scenario myself. Still, I wonder why MDG team did this? )
At Server end you also need to add little code at location PROJECT/server/main.js just outside Meteor.startup(()=>{}); to provide an email template for reset password link. Below is the code you need to adjust some properties yourself.
var username = 'you_id#gmail.com';
var password = 'your password';
var server = 'smtp.gmail.com';
var port = '465';
process.env.MAIL_URL = 'smtps://' +
encodeURIComponent(username) + ':' +
encodeURIComponent(password) + '#' +
encodeURIComponent(server) + ':' + port;
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
Accounts.emailTemplates.from = 'support_team#yourappname.com';
Accounts.emailTemplates.siteName = 'APP NAME';
Accounts.emailTemplates.resetPassword = {
subject(user) {
return "Reset Password Link.";
},
text(user, url) {
return `Hello!
Click the link below to reset your password.
${url}
If you didn't request this email, please ignore it.
Thanks,
APP Team.
`
},
html(user, url) {
// This is where HTML email content would go.
// See the section about html emails below.
}
};
STEP 1:
See if you are able to view forgot password on the signup widget as below.
STEP 2:
When you click "forgot password", you should be able to view below popup at same widget location as below.
on valid Email entry, you must see a success full notification and most importantly you must receive a mail for reset password link as below.
Step 3:
When you click on the link, you can see a new window with a popup as below (NOTE: You must click the link before given token expiry time).
Voila!!! just add a new password and you automatically login to given page. Everything is already provided to us as discussed above by Meteor. You just need to configure the stuff and get it running.
I have a application window with two text fields (no access to the application code, so cant change anything). User scans a barcode in the fields, the action "enter press" is programmed in the scanner and cannot be changed. I need to validate the fields before enter is pressed, I can validate the first field but the issue is I need to validate the second field before enter is press(which is through the scanner). Is there a way this can be achieved using AutoIT? I hope the question make sense.
Use the "AutoIt v2 Window Info" tool (Au3Info.exe) to identify the two edit controls. On the "Control" tab you find the "Advanced Mode", which will show data like "[CLASS:Edit;INSTANCE:2]". Now use this information to read the data of the control:
$Text1 = ControlGetText('window title', '', '[CLASS:Edit; INSTANCE:1]')
$Text2 = ControlGetText('window title', '', '[CLASS:Edit; INSTANCE:2]')
See the example here: http://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm
most barcode scanners can be programmed to not send the terminator (enter) usually by scanning a couple special barcodes in the users manual
I program scanners with special terminators so our program can tell the input was from a scanner and not key presses
I am trying to run a test on selenium IDE to enter to my Gmail, select the specific new email from all my email enter and click on a specific link that the email has.
I've been going round and round this and cannot find and answer!
I have read another post that has this help:
//div[#class = 'y6']/span[contains(., 'subject here')]
This does not help because the same email has been sent lots of times.
This case has the following particularities:
1. Since is a case that it will be run several times, emails with the same sender, subject and body will be send.
There should only be one new email every time the test is fun, since the idea is to enter and check the last email.
Inside the email there is a button that needed to be press, which I have the id, but I just need to enter the email to do so.
I have used the following CSS that so far has found what i need to click, but when I ask Selenium IDE to click it, it does nothing (clickAt, clickAndWait, clickAtAndWait... nothing!)
css=div[class=yW] > span.zF:[email='myemail#myemail.com']
I have also notice that the class="zA zE" in Gmail indicates that the email has not yet been read.
Help!
Thanks,
This is strange, because clickAt | css=div.yW > span.zF[email='myemail#myemail.com'] works fine for me. More than that, clickAt | css=span[email='myemail#myemail.com'] will always open first message(last one) with this email in the list.
BarbSchael,
A similar solution can be drawn by using Xpath of the FROM field.
I used this command:
clickAt | //table/tbody/tr/td[5]/div[#class='yW'] |
Click at the FROM field of first/recent/top most mail to go to mail detail page. // note: tr for first mail, tr[2] for second and so on.
I want to write a script in AutoIt, which can take automatic input from the keyboard, let's say A-Z, without user intervention.
Is this possible?
It is unlikely that your program needs to capture all input from all keys. If you do in fact need that kind of user input AutoIt might not be for you - see the post from the author of AutoIt about keyloggers. If you need to take keyboard input of the hotkey type: doing that in AutoIt is super easy.
HotKeySet("^+{q}", "reactionFunction")
While 1
; A loop
WEnd
Func reactionFunction()
MsgBox(0, "You pressed CTRL+Shift+q", "You pressed CTRL+Shift+q")
Exit
EndFunc
If you want to take user input from an input box that is really easy also.
$data = InputBox("Enter Something", "Enter some data in the field below.")
MsgBox(0, "The String You Entered...", "The string you entered is... " & $data)
More information about HotKeySet and InputBox can be found in the AutoIt.chm help file (it's actually a great reference).
Not sure I understand your question - you want to simulate keypresses without someone actually using the keyboard? If so, that's the send command in AutoIt.
You want to let a real user submit input to the script? That's what the GUI in AutoIt is for.