question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Protractor: How to navigate to external url by click an element using id ?

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
jakvirucommented, Jul 18, 2019

@ajitesh11 its is working 😃
Thanks

0reactions
ajitesh11commented, Jul 17, 2019

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 }

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found