Hi, I’m new to eggplant and just asking for some help if there is any way to change the delimiter in sensetalk of a csv file.
I’ve read the documentation regarding the csv functions (e.g. CSVValue, CSVFormat) but I don’t know how to integrate it in my dataextract code since the content of my csv file has a comma and sensetalk reads it as a delimiter therefore reading it as one and not decoding it as a normal string.
This is the loginpage function which enters the username and password into the webform
(Purpose: Function to enter username and password)
on doLogin username, password
log “Start doLogin”
//typetext username, tabKey
//typetext decodetext(username),tabKey
typeencodedtext username
typetext tabkey
typeencodedtext password
click text:“Log In to Sandbox”, SearchRectangle:[153,345,528,665]
waitfor 200, text:“Sandbox:”
if imagefound(text:"Sandbox:", SearchRectangle:[0,101,1344,139])
logsuccess "User is able to Login"
else
logerror "User is not able to Login"
capturescreen (Name: "Log in Error")
end if
wait 5
if imagefound("Common/showNotificationsPrompt")
click text:"Block",searchrectangle:[337,140,420,194]
end if
if imagefound("Common/savePasswordPrompt")
click text:"Never",searchrectangle:[1192,311,1285,361]
end if
log "End doLogin"
end doLogin
This the dataextract code block:
(Purpose: Function to enter generic login credentials)
on set_generic_admin_user dataPathFile, dataTCRow, dataFileType
log “start set_generic_admin_user”
if dataFileType equals “csv”
(put dataPathFile into userFileContents
set csvFile to file userFileContents)
put dataTCRow + 1 into dataTCRow
set csvFile to file resourcepath(dataPathFile)
repeat with each line of line dataTCRow of csvFile
put item 1 of it into global uname
put item 2 of it into global pword
end repeat
end if
log “end set_generic_admin_user”
end set_generic_admin_user
Really do hope someone helps me with this. Thanks! BTW if anyone needs the csv file just dm me. Thanks!