iOS Appium 1.9 - Clicking on parent of element using iOS Class Chain
up vote
0
down vote
favorite
I have an image within a collection view that I am unable to click on. Appium can find the element fine but using the is_displayed()
function always returns false. I read up on the iOS Class chain function so attempted to use that to click on the images parent XCUIElementTypeCell
(Which can be clicked on, but has no label, or name value annoyingly)
My attempt:
self._driver.find_element(By.IOS_CLASS_CHAIN, "**/XCUIElementTypeImage[`name BEGINSWITH "Click Me"`]/**/XCUIElementTypeOther/**/XCUIElementTypeCell")
This gives a NoSuchElementException
The app structure looks like this:
So that XCUIElementTypeImage
in the centre is what I am trying to target using name which equals "click me" in this example. The parent XCUIElementTypeOther
also can be found but is not clickable so the only solution for me is jump up two levels to the XCUIElementTypeCell
P.S Please no Xpath suggestions
P.S2 Thanks for the help
appium appium-ios python-appium
add a comment |
up vote
0
down vote
favorite
I have an image within a collection view that I am unable to click on. Appium can find the element fine but using the is_displayed()
function always returns false. I read up on the iOS Class chain function so attempted to use that to click on the images parent XCUIElementTypeCell
(Which can be clicked on, but has no label, or name value annoyingly)
My attempt:
self._driver.find_element(By.IOS_CLASS_CHAIN, "**/XCUIElementTypeImage[`name BEGINSWITH "Click Me"`]/**/XCUIElementTypeOther/**/XCUIElementTypeCell")
This gives a NoSuchElementException
The app structure looks like this:
So that XCUIElementTypeImage
in the centre is what I am trying to target using name which equals "click me" in this example. The parent XCUIElementTypeOther
also can be found but is not clickable so the only solution for me is jump up two levels to the XCUIElementTypeCell
P.S Please no Xpath suggestions
P.S2 Thanks for the help
appium appium-ios python-appium
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an image within a collection view that I am unable to click on. Appium can find the element fine but using the is_displayed()
function always returns false. I read up on the iOS Class chain function so attempted to use that to click on the images parent XCUIElementTypeCell
(Which can be clicked on, but has no label, or name value annoyingly)
My attempt:
self._driver.find_element(By.IOS_CLASS_CHAIN, "**/XCUIElementTypeImage[`name BEGINSWITH "Click Me"`]/**/XCUIElementTypeOther/**/XCUIElementTypeCell")
This gives a NoSuchElementException
The app structure looks like this:
So that XCUIElementTypeImage
in the centre is what I am trying to target using name which equals "click me" in this example. The parent XCUIElementTypeOther
also can be found but is not clickable so the only solution for me is jump up two levels to the XCUIElementTypeCell
P.S Please no Xpath suggestions
P.S2 Thanks for the help
appium appium-ios python-appium
I have an image within a collection view that I am unable to click on. Appium can find the element fine but using the is_displayed()
function always returns false. I read up on the iOS Class chain function so attempted to use that to click on the images parent XCUIElementTypeCell
(Which can be clicked on, but has no label, or name value annoyingly)
My attempt:
self._driver.find_element(By.IOS_CLASS_CHAIN, "**/XCUIElementTypeImage[`name BEGINSWITH "Click Me"`]/**/XCUIElementTypeOther/**/XCUIElementTypeCell")
This gives a NoSuchElementException
The app structure looks like this:
So that XCUIElementTypeImage
in the centre is what I am trying to target using name which equals "click me" in this example. The parent XCUIElementTypeOther
also can be found but is not clickable so the only solution for me is jump up two levels to the XCUIElementTypeCell
P.S Please no Xpath suggestions
P.S2 Thanks for the help
appium appium-ios python-appium
appium appium-ios python-appium
edited Nov 22 at 14:47
Wasiq Bhamla
52539
52539
asked Nov 19 at 16:58
King
118112
118112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Try the following:
"**/XCUIElementTypeCell[$type=XCUIElementTypeImage AND name BEGINSWITH 'Click Me'$]"
OR
"**/XCUIElementTypeCell[$type='XCUIElementTypeImage' AND name BEGINSWITH 'Click Me'$]"
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Try the following:
"**/XCUIElementTypeCell[$type=XCUIElementTypeImage AND name BEGINSWITH 'Click Me'$]"
OR
"**/XCUIElementTypeCell[$type='XCUIElementTypeImage' AND name BEGINSWITH 'Click Me'$]"
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
add a comment |
up vote
0
down vote
Try the following:
"**/XCUIElementTypeCell[$type=XCUIElementTypeImage AND name BEGINSWITH 'Click Me'$]"
OR
"**/XCUIElementTypeCell[$type='XCUIElementTypeImage' AND name BEGINSWITH 'Click Me'$]"
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
add a comment |
up vote
0
down vote
up vote
0
down vote
Try the following:
"**/XCUIElementTypeCell[$type=XCUIElementTypeImage AND name BEGINSWITH 'Click Me'$]"
OR
"**/XCUIElementTypeCell[$type='XCUIElementTypeImage' AND name BEGINSWITH 'Click Me'$]"
Try the following:
"**/XCUIElementTypeCell[$type=XCUIElementTypeImage AND name BEGINSWITH 'Click Me'$]"
OR
"**/XCUIElementTypeCell[$type='XCUIElementTypeImage' AND name BEGINSWITH 'Click Me'$]"
answered Nov 21 at 4:56
Alesia D
1
1
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
add a comment |
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Thanks I'll give it a go, what does the '$' sign refer to exactly?
– King
Nov 21 at 9:16
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
Doesn't work, seems that it's picking up the internal element. I've managed to get it working by using an xpath command and adding "parent::XCUIElementTypeOther" on the end, so it's not too long
– King
Nov 23 at 15:41
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379385%2fios-appium-1-9-clicking-on-parent-of-element-using-ios-class-chain%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown