Summer Sale! All accounts are 50% off this week.

jgmkanwar's avatar

Laravel Dusk

I am not able to enter values in text using XPath, could anyone suggest me how I can achieve this using XPath. I have used this but not succed $browser->driver->findElement( WebDriverBy::xpath("//html/body/div[1]/div/div[2]/div[2]/div[2]/div[2]/div/div/form/div[1]/input",$usernametosend) ); $sel = $browser->driver->findElement( WebDriverBy::xpath("//html/body/div[1]/div/div[2]/div[2]/div[2]/div[2]/div/div/form/div[2]/input",$passwordtosend) ); $browser->type('username',$usernametosend);

The issue is having the same name, class, and id for two different text boxes.

0 likes
3 replies
bugsysha's avatar

I would suggest that you change duplicated ID and name or add a dusk attribute that you can use to locate the element.

Please or to participate in this conversation.