What is the best way to conduct end-to-end testing on an Amazon Linux AMI?

Running end to end tests using Protractor has been smooth in Chrome and Firefox on Ubuntu. However, I encountered issues with PhantomJS as it could not locate the elements. My Angular version is v1.2.15. My aim is to test on an Amazon Linux AMI, so either I need to fix PhantomJS or install Chrome/Firefox, which seems complex. Is there a recommended browser for EC2 instances? The error message and stack trace are below:

UnknownError: {"errorMessage":"Unable to find element with id 'username'","request":    {"headers":{"Accept":"application/json, image/png","Connection":"Keep-Alive","Content-    Length":"33","Content-Type":"application/json; charset=utf-    8","Host":"localhost:28418"},"httpVersion":"1.1","method":"POST","post":"    {\"using\":\"id\",\"value\":\"username\"}","url":"/element","urlParsed":    {"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/elem    ent","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"",    "source":"/element","queryKey":{},"chunks":    ["element"]},"urlOriginal":"/session/7e7e8860-cb0a-11e3-b0d0-117406720391/element"}}
Build info: version: '2.40.0', revision: 'fbe29a9', time: '2014-02-19 20:54:28'
System info: host: 'Brendan-Kirby-BN', ip: '127.0.1.1', os.name: 'Linux', os.arch:     'amd64', os.version: '3.11.0-18-generic', java.version: '1.7.0_51'
Driver info: driver.version: unknown
   Stacktrace:
     Error
    at null.<anonymous> (/home/brendankirby/ads/apps/client/test/ads-login-spec.js:4:3)
    at Object.<anonymous> (/home/brendankirby/ads/apps/client/test/ads-login-spec.js:3:1)
At async task:
      UnknownError: {"errorMessage":"Unable to find element with id         'username'","request":{"headers":{"Accept":"application/json, image/png","Connection":"Keep-    Alive","Content-Length":"33","Content-Type":"application/json; charset=utf-    8","Host":"localhost:28418"},"httpVersion":"1.1","method":"POST","post":"    {\"using\":\"id\",\"value\":\"username\"}","url":"/element","urlParsed":    {"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/elem    ent","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"",    "source":"/element","queryKey":{},"chunks":    ["element"]},"urlOriginal":"/session/7e7e8860-cb0a-11e3-b0d0-117406720391/element"}}
Build info: version: '2.40.0', revision: 'fbe29a9', time: '2014-02-19 20:54:28'
System info: host: 'Brendan-Kirby-BN', ip: '127.0.1.1', os.name: 'Linux', os.arch:     'amd64', os.version: '3.11.0-18-generic', java.version: '1.7.0_51'
Driver info: driver.version: unknown
==== async task ====
WebDriver.findElement(By.id("username"))
    at Protractor.findElement     (/usr/lib/node_modules/protractor/lib/protractor.js:748:25)
    at Object.elementFinder.(anonymous function) [as sendKeys]     (/usr/lib/node_modules/protractor/lib/protractor.js:103:24)
    at null.<anonymous> (/home/brendankirby/ads/apps/client/test/ads-login-spec.js:9:32)

Below is the phantomjs log:

[INFO  - 2014-04-23T17:12:47.902Z] GhostDriver - Main - running on port 28418
[INFO  - 2014-04-23T17:12:48.363Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -    page.settings -     {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true    ,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent    ":"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko)         PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO  - 2014-04-23T17:12:48.363Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     page.customHeaders:  - {}
[INFO  - 2014-04-23T17:12:48.363Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     Session.negotiatedCapabilities -     {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1    .0","platform":"linux-unknown-    64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnable    d":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEn    abled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptS    slCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO  - 2014-04-23T17:12:48.364Z] SessionManagerReqHand - _postNewSessionCommand - New     Session Created: 7e7e8860-cb0a-11e3-b0d0-117406720391
[ERROR - 2014-04-23T17:12:50.308Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     page.onError - msg: SyntaxError: Parse error
[ERROR - 2014-04-23T17:12:50.308Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     page.onError - stack:
[ERROR - 2014-04-23T17:12:50.314Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     page.onError - msg: ReferenceError: Can't find variable: angular
[ERROR - 2014-04-23T17:12:50.314Z] Session [7e7e8860-cb0a-11e3-b0d0-117406720391] -     page.onError - stack:
  (anonymous function) (http://ads-qa.bnservers.com/scripts/a267e5f1.scripts.js:1)
[ERROR - 2014-04-23T17:12:50.686Z] WebElementLocator - _handleLocateCommand - Element(s)     NOT Found: GAVE UP. Search Stop Time: 1398273170644
[INFO  - 2014-04-23T17:12:52.211Z] ShutdownReqHand - _handle - About to shutdown

Answer №1

Utilizing a headless selenium server hosted in the cloud allows me to access Chrome and Firefox without the need for an actual display. For those interested, I have recently transferred the configuration files to this location: https://github.com/elgalu/headless

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with Angular Material date picker

While attempting to implement the md-datepicker component, I encountered some errors in the console. My HTML Code: <md-datepicker ng-model="vm.addfamilymember.dob" md-placeholder="Date of Birth"> </md-datepicker> Error Messag ...

Using Python Selenium Webdriver to locate and extract a specific div element following a specified one

Currently, I am attempting to utilize Python Selenium Firefox Webdriver for extracting the content of 'My Data Title' from the HTML provided below: <div class="box"> <ul class="navigation"> <li class="live"> ...

Adding properties to Vue.js component in the script section without affecting rendering

How can I import component A with props and pass it to another component B for rendering? import MyComponent from '/MyComponent.vue' computed: { compnt: function () { var comp = MyComponent // How can I set props to MyC ...

Updating input value in React on change event

This is the code for my SearchForm.js, where the function handleKeywordsChange is responsible for managing changes in the input field for keywords. import React from 'react'; import ReactDOM from 'react-dom'; class SearchForm extends ...

Encountered an issue while working with npm vue-cli

Operating System: Windows 10 Node Version: v8.9.2 NPM Version: 5.5.1 I successfully installed vue-cli using NPM, but encountered an error when trying to run 'npm run dev' command. Below is the error message: npm ERR! code ELIFECYCLE npm ERR! ...

Tabulating with jQuery Arrays

I am facing an issue when trying to perform calculations with certain numbers. Here is the specific code snippet causing trouble: for (var key in week_total) { $("." + key).html(week_total[key]); } After running this code, I keep getting a value of N ...

Objective: Remove all soft items from array stored in MongoDb using Mongoose

I have a unique Array property in my document that is filled with lovely fluffy objects. Now, I am looking to remove all objects within a specific range -> qdate:20210225. The property in the database is named weeks and appears as follows: [ { ...

What causes an exception when a space bar is recorded during a keypress event?

I encountered a problem in my code, here it is: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta ...

Getting the width of an element using a React ref is a helpful technique that allows you

I am struggling to retrieve the width of a select field using React Ref. https://i.sstatic.net/JJmqF.png this.selectRef.current is returning an object, but I can't seem to find a way to access the width of the element. <Select ful ...

Challenge with Expect.js validation in a lesson on Codeacademy

I am currently developing a lesson on Codecademy to teach users about the construction of HTML forms. This project is mainly for my own enjoyment, just to keep everyone in the loop. After reviewing the submission test guidelines and API, I made the decisio ...

Enter the values of the array into the designated inputs based on their class, one by one

Is there a way to assign each element of an array of strings to individual HTML fields based on their index? const pid = [ "688", "500", "450" ]; <input type="text" class="field_pid"> <input typ ...

Tips for altering Koa's HTTP status code for undeclared paths

If an undefined route is accessed on a Koa server, what is the best method to change the default HTTP status code and response body? Currently, Koa returns a 404 status and 'Not Found' text in the body. I intend to modify this to 501 (Not implem ...

What are the steps for enlarging the display containing components with the 'position: absolute' style?

How can I magnify the screen with the following code? .drawing-board { width: 25%; height: 25%; background-color: black; position: relative; /* transform: scale(2, 2); */ } .drawing-board .box-1 { width: 20px; height: 20px; background-c ...

jquery dialog content vanishing upon second opening

My jQuery code is set up to display a dialog when a button is clicked. The issue I'm experiencing is that after closing the dialog and reopening it, the text area within the dialog appears empty with only three buttons visible. However, upon subsequen ...

The error seems to vanish when commenting out the following div structure

Since upgrading to Angular 5, I've been encountering the following error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: undefined'. Current value: 'ngIf: null&apo ...

Angular Translate - Utilizing translate-values attribute for translation

Having trouble using angular translate with dynamic translation values that need to be translated first. If you want a better explanation of the issue, check out this plunker: PLUNKER <p translate="PARAGRAPH" translate-values="{username: ('us ...

Filtering an array results in an empty output

My task involves iterating through multiple date intervals, like: 09/06/2023 - 15/06/2023 28/05/2023 - 02/06/2023 17/06/2023 - 18/06/2023 29/06/203 - 04/07/2023 ...and so on I want to extract the day numbers for a specific month only, for example, June ( ...

Convert data into a tree view in JavaScript, with two levels of nesting and the lowest level represented as an array

Here is an example of a JSON object: [ { "venueId": "10001", "items": [ { "venueId": "10001", "locationId": "14", "itemCode": "1604", "itemDescription": "Chef Instruction", "categoryCode": "28", ...

Replacing Data in Lists and Arrays

When fetching data from the database, I store it in the variable $groups. Each entry has a different created_at timestamp. Before returning the data to the view, I want to overwrite the created_at field in the collection and format it nicely using ->di ...

Transferring data from an Excel spreadsheet to input fields on a webpage using Selenium, Python, and Openpyxl

I'm currently working on the following piece of code: from selenium import webdriver import sys import time import os import pyautogui import webbrowser import openpyxl from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.u ...