Caitlyn Daisy
Caitlyn Daisy

Reputation: 53

How to use I.attachFile in codeceptjs/protractor?

I.attachFile('input[type=file]', 'test.txt');

I try attachFile function in codeceptjs/protractor. I getthis error.

TypeError: driver.execute is not a function

chromeDriver:2.33
selenium-standalone:3.7.1
codeceptJS:1.0.3

"output": "./e2e/codeceptjs_tests/reports",
"helpers": {
  "Protractor": {
    "url": "http://localhost:4200/",
    "driver": "hosted",
    "browser": "chrome",
    "rootElement": "body",
    "smartWait":5000, 

Error Pic

Code Scope

Upvotes: 0

Views: 1713

Answers (2)

saadi chouaib
saadi chouaib

Reputation: 1

The syntax is right but you have to select the button in the first parameter not the field

I.attachFile('button','test.txt')

Upvotes: 0

j10
j10

Reputation: 109

Try it with I.attachFile('input[type=file]', 'lega-client/test.txt');

Upvotes: 0

Related Questions