Giter Club home page Giter Club logo

Comments (4)

dimadeveatii avatar dimadeveatii commented on June 9, 2024 2

But why xPath is the only solution? CSS selectors are supported and are very powerful. See :nth-child for example.
My advice is to first try to find a selector that returns the desired element using document.querySelector(...) in the browser console.

from web-automation.

dimadeveatii avatar dimadeveatii commented on June 9, 2024 1

This happens because your input is inside an iframe. There was no cucumber support for switching to an iframe, but I've just pushed it. If you get the latest changes, then this should work (I checked it):

Feature: Set an input inside an iframe

    As a user that opens a page
    I want to be able to change an input inside an iframe

    Background:
      Given I open the url "https://www.dintur.se/navigation/sok-resa/"

    Scenario: Update first input field
      When I switch to iframe "iframe"
        And I set "test 42" to the inputfield "#inpPointFrMobile"
      Then I expect that element "#inpPointFrMobile" matches the text "test 42"

from web-automation.

dimadeveatii avatar dimadeveatii commented on June 9, 2024

See the WebdriverIO's official documentation on searching using xPath queries.

from web-automation.

ratnose avatar ratnose commented on June 9, 2024

I have a hard time reaching a element on a page.
The page in question is: https://www.dintur.se/navigation/sok-resa/
It is a Wordpress page, I want to reach the first inputfield.

So far xpath has failed, id has failed so far I haven't tried nth child but... full xpath gives me shivers.
I will be using this on many WP sites so this will help me a lot.

from web-automation.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.