Comments (4)
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.
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.
See the WebdriverIO's official documentation on searching using xPath queries.
from web-automation.
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)
- Can reach element inside a flex HOT 1
- web-automation caches feature files? HOT 2
- Using the selenium:vnc - nothing shows? HOT 2
- pause for XXXXms - not working? HOT 1
- In clickElement.ts - Chrome adds a = to a selector, Firefox doesnt HOT 1
- Help: executing tests on windows HOT 3
- How to run using local browsers using 'selenium-standalone' service. HOT 1
- How to add a custom command HOT 1
- [question] Run multiple time HOT 1
- browser.getUrl returns promise
- cannot run it on saucelabs
- not working anymore
- Trying to reach an input field HOT 4
- After a few runs the app 'crashes'... HOT 3
- Screenshot not showing the area I am trying to reach HOT 1
- Dockerfile unused? HOT 2
- App crashed... HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-automation.