Questions tagged [javascriptexecutor]
18 questions
1
vote
1 answer
Checkbox is not selected in selenium java. Tried everything but nothing worked
I'm trying to fill in registration page for this the user will first be on the sign up page where they have to enter name and email address and then click on Signup button. This will navigate to the registration page where user will have to enter…

Rohit Mathur
- 23
- 3
1
vote
0 answers
Java Selenium executing a Javascript that deletes the browser IndexedDB Inbox
I have created a Java selenium automated test suite that tests a progressive web app. I want to delete the browser IndexDB in one of my tests. To do this I planned to create a 'JavascriptExecutor' onject in my Java Selenium test class. This is my…

ED209
- 588
- 1
- 9
- 26
1
vote
1 answer
casting of js.executeAsyncScript output to Map
I want to cast the output of below script into Map but it is showing "java.lang.String cannot be cast to java.util.Map"error.
How can we cast that in map??
final JavascriptExecutor js = (JavascriptExecutor) driver;
…

dazzyCrazzy
- 31
- 5
1
vote
1 answer
C# SendKeys command is not working in full execution
Sendkeys is entering the value for below search dropdown only in debug mode.It doesn't work in full run even after adding waits or clicking and entering the value.
Using Javascript, I'm able to enter the value in full run but search results are not…

Divya
- 15
- 2
0
votes
0 answers
retrieving and modifying javascript methods using Selenium
I am using Java with Selenium and Edge (IE compatibility). There is an embedded javascript method:
function onclick_DocType() {
var docPopURL = "http://my.url.com/docpop/docpop.aspx?clienttype=html";
var el_select =…

Tony
- 1,127
- 1
- 18
- 29
0
votes
0 answers
While trying get the color of the dot from web page I am getting error
The Error I am getting is Below:
org.openqa.selenium.JavascriptException:javascript error:Failed to execute'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'
I am trying to find the element and get the color of it and the element…

Akshay
- 1
- 1
0
votes
3 answers
Selenium JavascriptExecutor: Invalid or unexpected token
When trying to use this format of selector with SeleniumJavascriptExecutor:
js.executeScript("arguments[0].textContent=${value}", driver.findElement(By.cssSelector('div.stb-LazyChosenDropdown div.tiles div.input:nth-child(1)')))
The following error…

Steerpike
- 1,712
- 6
- 38
- 71
0
votes
1 answer
How to scroll inside form using Selenium
I'm trying to scroll inside form which is displayed in webpage. None of the scroll logic are working using Selenium. I tried to use Actions class as well as JavascriptExecutor, but scroll is not happening.
Steps:
Navigate to…

Arun
- 67
- 5
0
votes
0 answers
Not able to enter date in
this is my code
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
String date = dateFormat.format(tomorrow());
((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]", …
0
votes
0 answers
Is there A function that exists that can check if an element is a shadow root element?
So I have attempted this already with some code I got online. I think it may have something to do with the previous implementation.
The idea of this app is to dynamically scrape any website, doing the hard work first by literally scraping every…

devin
- 368
- 1
- 3
- 19
0
votes
0 answers
Java w/Selenium and JavascriptExecutor can't find the 3rd party message board elements on my page
The company I work for is (most likely) going to be adding spot.im (now Open Web) message boards to some of our pages to boost traffic. My boss is asking QA to look at automating some tests and to check out the admin and the controls available to…

KMan639
- 1
- 1
0
votes
1 answer
Selenium JavaScript executor for shadow root element works fine in normal browser but does not work in chrome headless browser
I'm testing a chrome extension using selenium 4.3.0 with Java and to open a chrome extension I have to get extension id which keeps on changing for every new build developers provide. To overcome this and not hardcode extension id in code, I though…

Dev Solanki
- 109
- 1
- 8
0
votes
0 answers
Calendar date picking using selenium-python javascript executor
I am trying to select a date from the application calendar using javascript executor but having some error using selenium python.
The xpath of the calendar item is = "//input[@placeholder='dd/mm/yyyy']"
I am going with xpath because other attributes…

Apratim Chaudhuri
- 11
- 1
- 6
0
votes
2 answers
JavaScript Executor Scroll Gesture Immutable Maps Arguments Issue
boolean canScrollMore = (Boolean) ((JavascriptExecutor) driver).executeScript("mobile: scrollGesture", ImmutableMap.of(
"left", 100, "top", 100, "width", 200, "height", 200,
"direction", "down",
"percent",…

parveen banu
- 1
- 1
0
votes
0 answers
Selenium sendkeys - text field getting reset to default value
Using Selenium python,I need to enter text in Age field, but unable to achieve after trying below ways.
webdriver sendkeys method and Actions-sendkeys method doesn't work so I tried jsexecutor which performs sendkeys correctly BUT when once i…

mohd aamer hussain
- 27
- 4