I'm trying to test my Ionic App using end to end testing with protractor. I want to test my search input which currently searches when the enter key is pressed. How do I issue an enter command with protractor in Ionic?
I've tried this:
browser.actions().sendKeys(protractor.Key.ENTER).perform();
But I get:
Cannot find name 'protractor
Related
I am using the command "start " to open a website when a user clicks a button. The button is part of a UI written in Progress 4GL (ADM). Using the "start" command I am able to open the website. But, is there some way to pass on Login credentials as well so as to log into the website?
Here's the code snippet I am using on click of a button -
OS-COMMAND SILENT start "<website>".
You can pass parameters using a "?" in the URL. For example, to pass a search value into Google, you can use this URL:
OS-COMMAND SILENT START "http://www.google.com?q=searchvalue".
Your browser will display Google's page with "searchvalue" already in the Search field.
Look at the source of your webpage and find the username and password field names. Use those in the URL, separated by a "&". That should fill in the values when your START command opens the web page.
I am trying to perform IE automation using PowerShell. While automating some manual task using IE object,
I am able to navigate to the website and enter value in text box, but the submit button is not available on website.
Getting output after clicking enter manually on ie page.
Trying to automate uploading .xml/pdf format files (Windows based popup) from local system to web application (Angualrjs) using Protractor framework.
Scenario:
Browser the application in Chrome> Click upload button> web app popup comes where able to locate elements > click Browse button on upload field (This field would be disabled, only click event is allowed which opens windows popup to browse files)> Here we have challenge to browse the file.
After clicking Browse button performed> Window popup shows Documents location however we want to browse and upload the file from Desktop or from Project location.
Followed other stackoverflow references as given below but unable to solve:
How to upload file in angularjs e2e protractor testing
Scripts which we tried:
iUploadConfigDefinition : (sPath) => {
var absolutePath = path.resolve(__dirname, sPath);
uploadInput.sendKeys(absolutePath);
}
Here not sure what should be 'uploadInput' element locator and how to recognize/fetch Open button of windows popup.
Please guide. Attached the screen for reference.
enter image description here
Please try the following solution :
browser.findElement(by.xpath("path of the browse button"));
browser.findElement(by.css('input[type=file]')).sendKeys('full path of the file with extension');
I have a feature to test. Here on page 1 i have to enter my username and password. then click on the login button. then the user is logged in and taken to a new page.
Selenium does not record anything once we move to a new page. I have to again open selenium in this new page and then strt recording if i want to.
This is stopping me from recording a complete flow.
is there any specific commands for selenium to read the new page an continue recording
PLease help me in this. how can i record
Thanks in advance
Instead try with Selenium Web-Driver, where you can do these kind of stuffs,
for more info refer to this question on Stack Overflow - "switch tabs using selenium Webdriver".
or you still want to achieve this with IDE?
I have a Selenium IDE (version 1.7.2) test that I use to test the registration flow on my site.
In this test, I simulate signing up for several different accounts. To do this, I recorded myself signing up for several accounts.
When I play the tests back, some of the accounts are registered ok, but other times the Submit button is clicked (the action turns yellow in the IDE) but it hangs, refusing to fail (turn red) or go on. However, if I manually click the submit button in the browser window again during the test, the test will continue and it will mark the submit button green as if it passed correctly.
How can I get it to click the submit button correctly the first time? Or is there a way to automatically get it to re-click if it times out?
Are you using clickAndWait??if yes then change it to click and put pause after click command.Or try to locate element by different ways, or hit enter to submit form as
`keyDown | locator of element/last field | \13`
as twall suggested
Did you use the command waitForElementPresent before calling the click command ?
I have found out that is more secure to just sendKeys("\n") (simulationg an 'enter' key press) instead of using click() when filling out forms. Don't ask me why, but it was a big relieve to me, after I had found out.