Protractor: How to navigate to external url by click an element using id ?
See original GitHub issueI am using protractor test at react js based webapplication. My test is simple, here is part of the code which i am using in my test script
var logo = element(by.id('facebook-logo')); browser.actions().mouseMove(logo).click().perform();
when i execute it i got this result in my terminal “W/element - more than one element found for locator By(css selector, *[id=“facebook-logo”]) - the first result will be used”
test passed but it is not navigating to external url.
Could you please help to solve this issue?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
How to test html links with protractor? - Stack Overflow
To click the link use click() , to check the current URL, use getCurrentUrl() : element(by.id('myLink').click(); expect(browser.getCurrentUrl()) ...
Read more >Protractor How to find element locators - YouTube
website - https://automationstepbystep.com/Today we will learn:1. How to find elements on webpage for Angular applications2.
Read more >Click & Hold | Protractor Tutorial | LetCode - YouTube
Hello Guys, in this video, we will learn how to perform click & hold action using Protractor.
Read more >Style Guide - Protractor - end-to-end testing for AngularJS
Declare all the page object public elements in the constructor ... /** @constructor */ var UserPropertiesPage = function() { // List all public...
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
In this article you will learn about most common AngularJS developer ... Clicking the button labelled “Change object” will change the bar property...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ajitesh11 its is working 😃
Thanks
Why you are using element.all with locator id ? element.all is used when you have multiple elements with same locator it is similar to driver.findElements method of selenium In your example question you were not using element.all
to make use of async await you can write async just before function () like it(‘should have a title’, aysnc function () { await works here }