how to verify the tooltip in extjs application with selenium ide - extjs

I learning automation of application with selenium ide.The application which I am currently testing is a extjs application.In this application all the required validations are shown in the tooltip.For ex: I have password form in which new password and confirm password are the two fields and there is a submit button.If the password entered in the new and confirm password field do not match then "Password do not match" message is shown in the tooltip and the submit button is disabled.In this case how to verify the tooltip and its contents in the selenium.
Plz can anyone suggest some solution to the above problem?All validation in my application are shown in the tooltip.
thanks,
sushi

First, make sure that you explicitly assign ids to your fields. Otherwise, it will be very hard to get a hold of the components with the automatically generated ids (like "ext-comp-004").
The strategy is to use the verifyEval Selenium command and use the Ext JS API to do certain things.
For checking the active error message of a field with id "password_confirm", you can use:
Ext.getCmp("password_confirm").getActiveError();
First, try this in the Firebug console manually to make sure it works for you. Then you can do the same in your Selenium script as:
Command: verifyEval
Script: Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
If you want to test this out with Selenium IDE in Firefox first, you should take into account that the window object will be wrapped in a XPCNativeWrapper. You can access the actual window object and the Ext JS namespace in it through wrappedJSObject:
Command: verifyEval
Script: window.wrappedJSObject.Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
For some general tips on testing Ext JS applications with Selenium, see this answer. Some parts of it may be outdated, but can still give you an idea about the general strategies involved.

Related

Unable to get Image Validation via recaptcha

I have incorporated Google ReCaptcha in my angular project on the client side and it was working fine. I have not changed anything but now I am unable to get image validation dialog box like I used to get before.
Now when I check on "I am not a robot" It verifies directly without asking for image validation and I am able to get the response string from Google API.
Is this behaviour is expected? and what can I do if I want Image validation after checking on "I am not a robot"?
I figured it out when I tried in another browser it asked me for image validation because after testing many times and verifying by my server, recaptcha does not ask for image validation.

How AutoFill password functionality in iOS app? Do i need to do any changes in my app if i want to add it?

I am not sure is autofill password functionality is totally iOS feature or developer will have to add some standard code to to use it?
It works automatically for UITextFields with UIKeyboardTypeEmailAddress type and enables secureTextEntry property. I checked it in an app released last autumn. Key button appears above the keyboard, asks of Touch ID on tap and presents keychain items. I was surprised, it fills related email and password to two text fields. Works like a charm!
Update: I found great tutorial implementation this feature: https://code.tutsplus.com/articles/faster-logins-with-password-autofill-in-ios-11--cms-29096. You can bind credentials saved from your site with the app directly.

Protractor adding request headers

I'm using protractor to test app that requires custom headers.
I am using for this 'modify headers' extension in chrome. How can I set them in protractor?
Actually is not possibly to add custom headers because of a limitation of Webdriver. There is an issue raised Protractor and Selenium, please refer to this thread: https://github.com/angular/protractor/issues/740:
Protractor (and webdriver, which it is built on top of) are intended to test your application like a user interacting with your page, so the meaning of browser.get is something like 'do what would happen if a user opened up a new tab and entered this URL'. So, there's no way to interact with under the hood things like setting headers, except for in the way that it would normally get done for your user.
Hope it helps.

manually able to log in but with salenium webdriver its showing invalid credentials,how to handle this?

i am using Selenium webdriver with java to automate an angularJS based app. Manually i am able to log in to the application but in automation its showing invalid credentials. I checked with credential, they are same. I tried two location strategies Css selector and Xpath results are same.
/*driver.findElement(By.cssSelector("#username")).sendKeys("9813555555");//username
driver.findElement(By.cssSelector("#password")).sendKeys("9813555555");//password
driver.findElement(By.cssSelector(".btn.btn-primary.login-btn")).click();//login
*/
driver.findElement(By.xpath("html/body/div[1]/div/div/div/div/div/div/div/form/div[1]/div/div/input")).sendKeys("98135555555");
driver.findElement(By.xpath("html/body/div[1]/div/div/div/div/div/div/div/form/div[2]/div/div/input")).sendKeys("98135555555");
driver.findElement(By.xpath("html/body/div[1]/div/div/div/div/div/div/div/form/div[3]/div[2]/button")).click();
the Css selector was duplicating and it was sending credential to admin instead of normal user .it was difficult to find as login ur at credential input was same.handled by editing xpath.

How to read text from Captcha in selenium webdriver

Hi I am having Captcha like 3+1= along with text boxes. I have to read the int values and enter the result in textboxes using SendKeys. I am able to capture the whole Capture image but I want to separate the each texts to add the numbers. How is it possible??
Can anyone please tell me??
Captcha meant for avoiding automated form submissions, if you are testing for the site, you can have a setting in the quality testing server to serve a specific captcha and use sendkey to send back
Selenium Webdriver is not supporting captcha.
While captcha is existing for the same reason so no one can use robot on the website.
You have to ask team to provide you special environment where they bypass the captcha functionality or ask your development team to expose the captcha values on DOM also so you can retrieve the value and then perform actions accordingly
Hope it will help you :)

Resources