this post was submitted on 21 Apr 2024
3 points (100.0% liked)

Selenium Web Browser Automation

91 readers
1 users here now

Users forum for selenium browser testing. Do not advertise here.

founded 1 year ago
MODERATORS
3
submitted 2 months ago* (last edited 2 months ago) by Yellowizer to c/selenium
 

Noob--I'm trying to automate verification of survey completion for 600 users. I can open the page fine, but struggle putting a value into the input box. What am I missing? Any help appreciated.

Website: https://gptw.care/vi

Input: document.querySelector("#root > div > div.MuiFormControl-root.MuiTextField-root.jss16")

#SingleInstance, force
#Include, Lib\Chrome\Chrome.ahk ;https://github.com/G33kDude/Chrome.ahk/releases

; verify if the profile folder exists
; if not, create it
if !FileExist("profile")
FileCreateDir, % "profile"

; load the chrome object pointing to the folder created above
; and the link to the page (or pages) to open at startup
chrome := new chrome("profile", "https://gptw.care/vi")

; get the first page (you can use other functions to select a specific page, like GetPageByTitle() or GetPageByURL())
pg := chrome.getpage()

; wait for the page to finish loading before clicking anything.
; clicking on an nonexistant element results in an error
pg.WaitForLoad("complete")

; pass arbitrary javascript to the page. This allows you to do virtually anything you want
; with the page
pg.Evaluate("document.querySelector('#root > div > div.MuiFormControl-root.MuiTextField-root.jss16').value = '7654321'")

return
no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here