xpath - Click an element based on attribute -


मेरे पास यह कोड है:

  & lt; div class = "menuFamille" idcat = " 1025 "& gt; & Lt; div class = "menuFamilleButton on" & gt; आइटम 1 & lt; / div & gt; & Lt; / div & gt; & Lt; div class = "menuFamille" idcat = "1026" & gt; & Lt; div वर्ग = "मेनूफिमिलीबटन ऑन" & gt; आइटम 2 & lt; / div & gt; & Lt; / div & gt;  

मुझे पता नहीं है कि कैसीपर जे एस में idcat = "1025" के साथ पहली डिवीज़ पर कैसे क्लिक करें क्या मुझे XPath का उपयोग करना चाहिए?

बस एक विशेषता चयनकर्ता (सीएसएस) का उपयोग करें। XPath अभिव्यक्ति की कोई आवश्यकता नहीं है, लेकिन मैं इसे तुलना के लिए जोड़ूंगा:

  casper.click ("। Menufamille [idcat = '1025' ] & Gt; .मेनूफिमेललेबटन ");  

या

  कैस्पर.क्लिक करें (x ("// * [इसमें (@ वर्ग, 'मेनू फ़ामिली ') और @ idcat =' 1025 '] / * [इसमें (@ वर्ग,' मेनूफिमिलीबटन ')] "));  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -