by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:44
    jsf-clabot commented #5604
  • 16:44
    morrme opened #5604
  • 15:49
    morrme commented #5603
  • 15:47
    morrme commented #5603
  • 11:42
    jayandran-Sampath commented #5602
  • 09:30
    christian-bromann labeled #5603
  • 09:30
    christian-bromann labeled #5603
  • 09:30
    christian-bromann labeled #5603
  • 09:30
    christian-bromann labeled #5603
  • 09:30
    christian-bromann opened #5603
  • 09:27
    christian-bromann commented #5602
  • Jul 11 15:46
    elaichenkov closed #5586
  • Jul 11 12:58
    jayandran-Sampath commented #5602
  • Jul 11 09:48
    jayandran-Sampath edited #5602
  • Jul 11 09:47
    jayandran-Sampath opened #5602
  • Jul 10 23:41

    christian-bromann on master

    Have `remote` and `multiremote`… (compare)

  • Jul 10 23:41

    christian-bromann on cb-typedef-fix

    (compare)

  • Jul 10 23:41
    christian-bromann closed #5599
  • Jul 10 23:41
    christian-bromann unlabeled #5599
  • Jul 10 23:41
    christian-bromann labeled #5599
Sean El-Sayed
@seanuleh

Is there a way to wrap all element commands? I have an issue with a single browser where I randomly get a popup complaining about certs. The Browser is Win7 IE11, and the implication is that the element commands generate a /execte W3C request which will occasionally return a HTTP 500. I would like to wrap the commands and try to catch this specific error and force a retry. Unfortunately, dealing with the underlying cert issue is not possible and this seems to be the easiest option I can think of. I can wrap all my tests in a try-catch to handle it, but that is a lot of rework as I will have to change every test.

The specific error looks like this in selenium logs:
17:48:55.280 DEBUG - sun.net.www.MessageHeader@b6db216 pairs: {null: HTTP/1.1 500 Internal Server Error}{Content-Length: 235}{Content-Type: application/json; charset=UTF-8}{Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept}{Accept-Ranges: bytes}{Connection: close} 17:48:55.281 INFO - To downstream: {"sessionId":"91146b96-7c25-4d1c-a679-063c4683dfae","status":26,"value":{"alert":{"text":"Revocation information for the security certificate for this site is not available. Do you want to proceed?"},"message":"Modal dialog present"}}

The modal seems to be dismissed or accepted immediately since in my testing, there are no other window handles available when this happens. It just causes some tests to bomb out unnecessarily. Open to any other ideas on how to handle this, but I think the easiest way is to add a try-catch around the test and retry on this specific error. But I do not want to override each element command individually.

Sean El-Sayed
@seanuleh
To those interested, I solved by writing a generic overwrite function and registered it to multiple overwrite commands:
  /* Overwrite default element command behaviour to fix IE issues */
  function overwriteFunction(origFunction, ...args) {
    try {
        // attempt to execute Original function
        return origFunction(...args);
    } catch (err) {
        if (err.message.includes('Modal dialog present')) {
            console.warn('WARN: Element', this.selector, 'threw an error and we are retrying.')
            return origFunction(...args);
        }
        throw err
    }
  };
  browser.overwriteCommand('scrollIntoView', overwriteFunction, true);
  browser.overwriteCommand('$', overwriteFunction, true);
  browser.overwriteCommand('getAttribute', overwriteFunction, true);
  browser.overwriteCommand('getText', overwriteFunction, true);
  browser.overwriteCommand('getLocation', overwriteFunction, true);
GYANENDRA PANDEY
@gyanendrapmca
I'm unable to send value in textbox using setValue method, how to perform this action- driver.getKeyboard().sendKeys("textToBeTyped"); ??
Daljit Singh
@daljit08_gitlab
if am creating config file and its asking me "? Do you want to run WebdriverIO commands synchronous or asynchronous? async" and in my test i use async and await. but in my config files it does not mentioned that it should run in synchronous or asynchronous way. So how webdriver know ?
GYANENDRA PANDEY
@gyanendrapmca
@daljit you can set manually sync: true or async: true
26 replies
GYANENDRA PANDEY
@gyanendrapmca
in this scenario, how to setvalue in edittext????? anyone please help me....
Erwin Heitzman
@erwinheitzman
setValue | keys command?
GYANENDRA PANDEY
@gyanendrapmca

setValue | keys command?

It's not working, due to keyboard enabled here- i faced same issue in appium/java also and resolve using this- driver.getKeyboard().sendKeys("jschwartz"); But, i didn't found anything here, how to handle this thing.

6 replies
Avikash Gorka
@avikashg

image.png

Nested describe blocks have an extra entry in the mocha reports

Ranjith Samalla
@Ranjithsamalla
HI
image.png
Im getting this error white running script in android mobile can any one help what is cause here
Avikash Gorka
@avikashg
Hi, just started using webdriverio.
I am having issues in nested describe blocks.
nitinWFH
@nitinWFH
hi
matrixbot
@matrixbot
swindlerabbit what issues?
nitinWFH
@nitinWFH
is there a way to connect to AWS s3 bucket and copy files
on local
how to connect thorugh wdio
Simon Wilson
@simonwilson1985

Hi all, I am having some issues with modals in headless chrome not working properly. As a test I set this up:

describe("test", function() {
    it("test", function() {
        browser.url("https://getbootstrap.com/docs/4.3/components/modal/");
        browser.debug();
    })
})

if I take a screenshot of that page then I just get a blank page. However, in non-headless mode it works fine.
Any ideas?

Christian Bromann
@christian-bromann
@avikashg would be great if you could explain the issues you are having
4 replies
@Ranjithsamalla seems that your Appium setup is not correct
@nitinWFH can you explain what you want to “connect”?
Simon Wilson
@simonwilson1985
nitinWFH
@nitinWFH
thanks Simon..
i want to connect to AWS S3 bucket and copy csv files to local machine for further processing
matrixbot
@matrixbot
swindlerabbit Avikash Gorka (Gitter): I had the same issue with mochawesome after upgrading to wdio 5 it doesn't seem like nested describes work properly anymore.
Simon Wilson
@simonwilson1985
@nitinWFH there's documentation in there and on AWS page that explains how to do this
nitinWFH
@nitinWFH

@nitinWFH there's documentation in there and on AWS page that explains how to do this

ok, can you share any link

nitinWFH
@nitinWFH
Caleb Jaquith
@calebjaquith_twitter

Is this warning suppressable?

[0-0] RUNNING in chrome - /tests/specs/basic.js
[0-0] Warning! Unsupported expect lib is used.
Only Jasmine >= 3.3.0 and Jest's expect are supported.
expect-webdriverio is assigned to global.expectWdio

I imagine if I let the native assertion library use expect that'd be fine, but I like using that instead of chai.expect

4 replies
harismahesh
@harismahesh_twitter
Appium with webdriverio I am getting following errors. Any idea why its coming ?

A service failed in the 'onPrepare' hook
Error: Appium exited before timeout (Exit code: 2)
at ChildProcess.exitCallback (/private/tmp/scratchkLlkKg.scratch/test-packageVJzcYO/node_modules/wdio-appium-service/build/launcher.js:94:28)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Continue...
ERROR: ESOCKETTIMEDOUT
4545b75e9e343eb8ba9de068016dd13d5f192e71.ios
at new RuntimeError (/private/tmp/scratchkLlkKg.scratch/test-packageVJzcYO/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:143:12)
at Request._callback (/private/tmp/scratchkLlkKg.scratch/test-packageVJzcYO/node_modules/webdriverio/build/lib/utils/RequestHandler.js:332:43)
at self.callback (/private/tmp/scratchkLlkKg.scratch/test-packageVJzcYO/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at ClientRequest.<anonymous> (/private/tmp/scratchkLlkKg.scratch/test-packageVJzcYO/node_modules/request/request.js:819:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at Socket.emitTimeout (_http_client.js:718:34)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at Socket._onTimeout (net.js:422:8)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)

@christian-bromann
Olga
@osmolyar
@ofindley , that {reverse:true} parameter syntax is only for v6. For v5 it's $(selector).waitForExist(ms, reverse, error) (documentation: https://v5.webdriver.io/docs/api/element/waitForExist.html)
1 reply
Lecale
@Lecale
Hello. Is there any way to match in case insensitive mode. I'm thinking of iframe(src*='ExampleApp') which is sometimes served as exampleapp, sometimes as ExampleApp.
Olga
@osmolyar
@Lecale, how about iframe(src*='xample') :D There is also an 'or' syntax for xpaths, match a or b
Owen Carter
@kraggerz

Hi All i'm a bit new to the 'setting up' of automation frameworks. I've got an electron desktop app which I've configured to run spectron which under the hood accesses webdriverIO. Now i've used webdriver before i.e I recall the browser object. Reading online the browser object is application.client.

My automation test access the webdriverIO functions which is awesome! The only problem is. The intelisense for webdriverIO in spectron application.client does not show in VSCode for methods like element(), .getText(), pause(). The things native to webdriverIO how do I get them to appear to the programmer?

image.png
Lecale
@Lecale
but risky to cut out parts of the src tag unfortunately
Martijn Kuhlemeier
@martijnhjk
Hey, does anyone know if you can define custom matchers for expect-webdriverio? there is no mention about it here: https://webdriver.io/docs/api/expect.html
Erwin Heitzman
@erwinheitzman
Not sure but quite likely as it's just an extension @martijnhjk I'd just try it out as it's the fastest way to an answer to that question
12 replies
@kraggerz not sure if I am right on this but I think you need to extend you app with the WebdriverIO types
Olga
@osmolyar
@Lecale then you can try the xpath 'or' syntax; iframe(src='ExampleApp') or iframe(src='exampleapp')
Lecale
@Lecale
okay, i will try that. Is it in the webdriverio docs? I don't find it.
Erwin Heitzman
@erwinheitzman
@Lecale sounds like a nice thing to fix in the frontend code rather then to create a workaround in the test ;)
Lecale
@Lecale
tell me about it :)
Olga
@osmolyar
@Lecale it's not in the webdriverio docs; just basic xpath operators: https://www.w3schools.com/xml/xpath_operators.asp.
But actually something like this might be better:
 //iframe[contains(lower-case(@src), ‘exampleapp’)]
Olga
@osmolyar
Documentation for xpath contains syntax: https://www.scientecheasy.com/2019/11/xpath-contains-text.html/
Olga
@osmolyar

@Lecale Apparently there's also a 'matches' option with a case-insensitive flag 'i' in xpath 2.0:

//iframe[matches(@src,'exampleapp','i')]

Ref. https://stackoverflow.com/questions/2893551/case-insensitive-matching-in-xpath