Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
Change a agSelectCellEditor drop down value using selenium

I am trying to access values in a drop down which when I inspect, nothing is been in element inspector. I confirmed with developer what type of drop down is that he said agSelectCellEditor drop down. We then tried using following Javascript code in console which was changing the drop down values.

var x=document.querySelector("div[aria-colindex='3'][class='ag-cell ag-cell-not-inline-editing ag-cell-auto-height ag-cell-value ag-cell-wrap-text ag-cell-focus']
x.textContent="Custodian"

So that changed the drop down value from default value to Custodian. Now I tried to inject this code in JavaScriptExecutor like this.

JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("var x=document.querySelector(\"div[aria-colindex='3'][class='ag-cell ag-cell-not-inline-editing ag-cell-auto-height ag-cell-value ag-cell-wrap-text ag-cell-focus']\")"
+ "x.textContent=\"Custodian\";");

It is giving me exception org.openqa.selenium.JavascriptException: javascript error: Unexpected identifier

Please help me automating this using Selenium. How to deal with this dropdown?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!