Forum Discussion
Hi,
> Use Xpath and Css selectors checkbox is also selected
If you are talking about 'Use XPath and CSS selectors for web objects' project properties option, then .FindElement() method must be used instead of .FindChildByXPath().
- Gunacelan5 years agoContributor
FindElement also doesn't work. Not sure what is the reason
- Gunacelan5 years agoContributor
And what if I uncheck the 'Use Xpath and css selectors' property , will FindChildByXpath work?
- AlexKaras5 years agoCommunity Hero
Hi,
> FindElement also doesn't work. Not sure what is the reason
Can you post a screenshot of the code and log?
> if I uncheck the 'Use Xpath and css selectors' property , will FindChildByXpath work?
Yes, it should, but this will disable cross-platform mode and switch back to default local one. (So you will not be able to execute your tests in CrossBrowserTesting and other cloud environments.)
> Sys.Browser("chrome").Page(...).FindChildByXPath(...);
Another possible reason is that page was not navigated to.
- Gunacelan5 years agoContributor1) I tried this without the checkbox "Use Xpath and css selectors" checkedSys.Browser("chrome").Page(*).FindChildByXPath("//button[normalize-space(text())= 'Advanced']");
orSys.Browser("chrome").Page("*").findchildbyxpath(%22//button[normalize-space(text())='*').FindChildByXPath(%22//button[normalize-space(text())=" target="_blank" rel="noreferrer noopener">).FindChildByXPath("//button[normalize-space(text())= 'Advanced']");2) I tried FindElement selecting the checkbox and Using the below codeSys.Browser("chrome").Page("*").findchildbyxpath(%22//button[normalize-space(text())=" href=""*").FindChildByXPath(%22//button[normalize-space(text())=" target="_blank" rel="noreferrer noopener">*").FindChildByXPath("//button[normalize-space(text())= 'Advanced']").FindElement("//button");or
Sys.Browser("chrome").Page("*").FindElement("//button");