IOS XPATH through Appium

Viewed 163

Hi I am trying to find xpath of toogle button to on and off for privacy setting in IOS device.

I tried with xpath:- xpath=${pro_on_off_ios} //XCUIElementTypeSwitch[@name="Link name and photo"].

and with this xpath switch is off and on vice versa,but I want to get the value of switch that its on/off and use as per our requirement.

I tried with that for value : ${Privacy_setting} AppiumLibrary.Get Text xpath=${pro_on_off_ios}.

but its not able to find.

1 Answers

Its solved,

I used get attribute and by value I got the desired result.

${setting}= GET ELEMENT ATTRIBUTE xpath=${//XCUIElementTypeSwitch[@name="Link name and photo"]} value

Related