Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

$driver.By.linkText - Having problems with links with spaces


#1

Hello,

I have this in my script:

// Select System Configuration
$browser.findElement($driver.By.linkText("System Configuration")).click();

Unfortunately the script keeps timing out. However, if I replace the linkText with the name of a single word link “Rates” in this case, the script works just fine. “Rates” and “System Configuration” both appear on the same menu. The difference between them seems to be the one word link vs two word link.

Anyone have any suggestions on how to work around this?


#2

Thanks for posting to the forum!

I believe the problem here is the space between your two words might be interpreted as &nbsp, which would interfere with the exact match the linkText is looking for. Try replacing that line in your script with this:

$browser.findElement($driver.By.partialLinkText("System Configuration")).click();

The partialLinkText will look is a bit less conservative when searching, and should be able to find a match.


#3

HI, I also encountered the same issue using By.linkText with spaces, as suggested i replaced it with By.partialLinkText but still i get time out issue. Any help?


#4

Hi @Shashidhar.Naik, would you mind providing a permalink to the monitor you are having issues with and I can take a closer look :slight_smile: