How to input email and password for PayPal using Selenium2Library? - paypal-sandbox

I am trying to input email and password into PayPal (sandbox mode) using my Robot Framework script. This is a snippet of my code:
input text login_email ${email}
input text login_password ${password}
login_email is the name of the input field for the email and login_password is for the password.
I am passing the email in the ${email} argument and the password in the ${password} argument.
This doesn't seem to work for some reason. I keep getting this error:
InvalidElementStateException: Message: Element is not currently interactable and may not be manipulated
The email and password field for PayPal are generated upon the loading of the page. Can that be a reason why they are not accessible? Can anybody help me identify what am I doing wrong here?

As Correctly said by Ofer Steinberg , try to find the XPATH manually
Also, add a wait point until that item is visible and the enter name and password
as many times item is present and hidden due to which it says item not interactable.

It seems you have there a 'not constant' id (or similar..).
I had this problem, and the solution was to change the input path from id to xpath.
Moreover, try to inspect the paths manually in 'guest mode' (I guess you using chrome), it should show that page source more accurately since the selenium running by it.

Related

strange text when extract the body of email from Gmail using IMAP

iam using QT and Qsslsocket to get some emails body from Gmail using IMAP, I started using the IMAP command to log in, check how many emails I have, and fetch the data from the email I selected I use this commands sure after connected to IMAP using hostname and port.
tag login username password
after login and check the number of messages using tag select inbox I use this command to extract the body of the email.
tag fetch message_number (body[1])
the problem is i got very strange words like this
* 5 FETCH (BODY[1] {1856}
SGkgRmVsaXggYW5kIEZpbmdlcnMgRHVlbGluZyBQaWFub3MsCgpWaWN0b3JpYSBBLiBoYXMg
dXBkYXRlZCB0aGVpciBldmVudC4KClRoZSBwZXJmb3JtYW5jZSBsZW5ndGggaGFzIGJlZW4g
Y2hhbmdlZCB0byAzIGhvdXJzLgoKVGhlIHBlcmZvcm1hbmNlIHN0YXJ0IHRpbWUgaGFzIGJl
ZW4gY2hhbmdlZCB0byA1OjAwcG0uCgoKCgpVc2UgdGhlIGxpbmsgYmVsb3cgdG8gdmlldyB0
aGlzIGxlYWQ6Cmh0dHA6Ly90cmFja2luZy5naWdzYWxhZC5jb20vdHJhY2tpbmcvY2xpY2s/
ZD1RS1FFeEQxZGtIQTZrYWE3YzFXSzcxZ2VDVXBNX0F5UFRkcU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5vdCByZWNvbW1lbmRlZCk6Cmh0dHA6Ly90cmFja2luZy5naWdzYWxhZC5jb20v
dHJhY2tpbmcvdW5zdWJzY3JpYmU/bXNnaWQ9UzQzLVFsVDVBbHhiaUl0SmhxU0NuZzIKCsKp
IFRoZSBHaWcgQnVyZWF1LCBMTEMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuIFBlYWNlLCBsb3Zl
ICYgZ2lnc8KuIGlzIGEgcmVnaXN0ZXJlZCB0cmFkZW1hcmsgb2YgVGhlIEdpZyBCdXJlYXUs
IExMQy4KMjczMyBFLiBCYXR0bGVmaWVsZCBSZCAjMTA1IFNwcmluZ2ZpZWxkLCBNTyA2NTgw
NA==
)
but the email contains normal message have normal words the strange is when i test with another gmail, i take this email from first email and send it forward message to my second email, it give me the normal text in it! so please any help i can't understand what is the problem, also what i tried is using openssl which give me same result as QT strange words, and javaMail library and extract text from first email it worked? so is the problem from the imap command i used or what?
Thanks in advance.
this a screenshot of the email message
Update
when i start some search i checked that this message is encoded to base64 and when i used online decoder it convert to the normal text but the question now is what command should i use so that i can fetch this message body text in normal text automaticly if there is such away.

Robot framework: How to locate a lone input text field using Xpath

I am a newbie but keen into test automation. Please don't hesitate to send and reply ANY hints you have.
So the problem is that I've faced a web page where there is input field but there is no ID for it in source. Input field has type=text AND that input field is THE ONLY on that page. I have not been able to locate that element with Robot Framework (+PyCharm) but I have a feeling that it should be possible some way in Xpath? Please help me.
Using Input Text xpath=//INPUT[#type='text'] test -> gives this error:
"InvalidElementStateException: Message: invalid element state:
Element is not currently interactable and may not be manipulated"
I am afraid that the ancient framework used in system under test is the problem. It's called GWT-ext and in many cases there exists id for element but it's generated randomly every time so that cannot be used as locator of the element. That's why I need to use other ways, like field names, types etc.

Extract part of an URL behind a login page with Paw

I'm a newbie but I think Paw can do what i need :
I need to extract a session id behind a login page.
I go to https://admin.booking.com, filling the form (login and pass) and the landing page behind includes a session id :
https://admin.booking.com/pc/index.html?ses=xxxxyyyyyzzzzz11112222233333
I'd like to :
1) Push credentials with Paw as part of my request,
2) get the above item (ses) item as a response so i can use the php script extension provided by Paw and then call this script "on demand".
Is this possible ? If so, what should i do ?
Thanks for your help
UPDATE*: we've added a documentation article to describe the process a little more: Login via a web form in Paw. We've detailed the process to deal with CSRF tokens too.
Paw isn't quite yet ready for handling web/HTML forms. Though, there's one way to do it the right way: if you inspect the form with the Chrome dev tools you'll find the name of the input from the DOM/HTML:
In your case, you have the inputs: loginname, password, lang.
Also, find the <form…> tag to see what's the action attribute. If there's no action attribute (like in your example), it means the target URL for your form is the current page's URL (https://admin.booking.com/ in your case). Also, make sure the method="POST" is also there in the <form…> tag, otherwise this method won't work.
Then jump into Paw and set:
URL (in your case https://admin.booking.com/)
method to POST
go to the Body tab and use "Form URL-Encoded + fill up the fields from your form
If all works, you'll see Paw show a redirection request, and if you go to the right-hand side panel under "Response" > "Headers", you should see a Location header with a value similar to the URL you initially mentioned (https://admin.booking.com/pc/index.html?ses=xxxxyyyyyzzzzz11112222233333). Hurray! You got your value into Paw!
Now that you have that, you can create in a new request (click on the + button at the bottom of the left-hand side list). And wherever you want to use this session token/ID, you can insert a dynamic value to retrieve that URL value. You have more infos here, in our docs, but I'll describe the steps here:
On whichever field you want to insert the token, right-click and pick Responses > Response Header.
Make sure you pick the first request in the "Request" dropdown menu, and enter Location in the "Header" field:
You should see the value of the Location header of the previous response appear here.
Now what you want to do is to extract only the part you want (i.e. the value of the ses param in your case). For that you'll need that extension for Paw, so please install it now: https://luckymarmot.com/paw/extensions/RegExMatch
Copy the dynamic value you have just inserted (the blue token), and right-click on that field to insert a new dynamic value, and pick Extensions > RegExp match:
In the Input field, paste the previous dynamic value you copied. And use the RegExp field to write a regular expression that will successfully extract the part of the URL you want (this should work in your case ses=(.*)).
Now that you're set up. You should be able to use this little new blue token wherever you like and automagically extract the value from the previous form. And whenever you send again the initial request, and get a new token, everything else will also update! :)
It was a little long guide, but I hope this will help you and hopefully others too.

Confirm Password in Oracle Application Express

I have a form in Application Express where I let the user edit their details, update their password etc.
I would like to use the usual method of having the user type in their password twice and make sure the two passwords are typed identically so I can be sure they have have not made a mistake typing.
However, since both elements are form fields on the same page I can't see a way to compare them. Any direction would be appreciated.
If you are okay with checking they are identical during the submit you can simply do this in a page validation.
Let's say you have P1_NEW_PASSWORD and P1_NEW_PASSWORD_CONFIRM.
Then in the page processing box expand 'Validating', right click 'Validations' and choose 'Create'.
Choose 'Page Item', P1_NEW_PASSWORD, choose a name and as validation type choose 'PL/SQL', then 'PL/SQL Expression'. Enter :P1_NEW_PASSWORD = :P1_NEW_PASSWORD_CONFIRM as Validation Code, and choose an error message. Now create your validation.
Now when you try to submit the page and the passwords don't match, you will get an error message.

Drupal: How to format email message using node invite module?

I am using the node invite and token module.
I have followed this flash tutorial video: http://www.adevbox.com/files/2008-06-25_1703.swf
My problem is regarding the email format being sent.
In the ?q=admin/settings/node_invite
I have checked the blog entry checkbox. Now the node invite works but I can't format my body section value correctly.
For example:
I entered in the textarea
Hi <bold>
Then the result when I open the email message is still the same:
Hi <bold>
Same with if I use <b>bold here</b> then it will also be the format when I open the email message.
How can I format it correctly? Am I missing something simple? I am thinking of using htmlspecialchars but I don't where to put it.
Thanks in advance :)
Kind Regards,
Mark
My understanding of the Invite module is that there is no Input Filter for the template. This means that the only format that is accepted is plain text. This means that it will convert HTML into the escaped code you see.
You can validate this looking at the variables in the database. Your best bet it so path Invite (or ask for a features) to allow HTML as a valid format.

Resources