- Bindhu
- Posts : 5
Join date : 2012-09-12
Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 4:48 pm
I had a doubt in Selenium. It would be of great help if any one could support me in solving this issue.
The scenario is as follows:
We want to create a Contact, edit and delete the created contact. We are able to create contact but when it comes to edition and deletion we are facing some issues.
1. Create a Contact
2. Try to edit this contact, now selenium catches the X path position (//div[6]/table/tbody/tr/td[2]). No other target values are listed under the Target drop down. So when this particular contact is taken for edition, some other contact details are shown( There is some problem in the positioning of the rows)
If we create one contact, do edition or deletion it works fine but if there are more than one record, we face the above issue.
The scenario is as follows:
We want to create a Contact, edit and delete the created contact. We are able to create contact but when it comes to edition and deletion we are facing some issues.
1. Create a Contact
2. Try to edit this contact, now selenium catches the X path position (//div[6]/table/tbody/tr/td[2]). No other target values are listed under the Target drop down. So when this particular contact is taken for edition, some other contact details are shown( There is some problem in the positioning of the rows)
If we create one contact, do edition or deletion it works fine but if there are more than one record, we face the above issue.
- sharathRegular Participant
- Posts : 29
Join date : 2012-08-04
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 5:09 pm
Hi Bindhu,
For Xpath position you can use xpath checker Add on and check.It is more efficient.Let me know what happens after that.
Regards,
Sharath
For Xpath position you can use xpath checker Add on and check.It is more efficient.Let me know what happens after that.
Regards,
Sharath
- Bindhu
- Posts : 5
Join date : 2012-09-12
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 5:56 pm
Thanks for the reply, tried as per your instructions but still the same error occurs saying that
[error] Element /x:html/x:body/x:div[3]/x:div[4]/x:div[3]/x:div[2]/x:div/x:div[28]/x:table/x:tbody/x:tr/x:td[2] not found.
[error] Element /x:html/x:body/x:div[3]/x:div[4]/x:div[3]/x:div[2]/x:div/x:div[28]/x:table/x:tbody/x:tr/x:td[2] not found.
- sharathRegular Participant
- Posts : 29
Join date : 2012-08-04
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 6:04 pm
In target you have to give the command as follows
xpath=/x:html/x:body/x:div[3]/x:div[4]/x:div[3]/x:div[2]/x:div/x:div[28]/x:table/x:tbody/x:tr/x:td[2]
Please include xpath= before the xpath position .try and let me know
xpath=/x:html/x:body/x:div[3]/x:div[4]/x:div[3]/x:div[2]/x:div/x:div[28]/x:table/x:tbody/x:tr/x:td[2]
Please include xpath= before the xpath position .try and let me know
- Bindhu
- Posts : 5
Join date : 2012-09-12
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 6:36 pm
Now as per you suggessted the Xpath was given. actaully this Xpath function shows a fixed path of row 2 but as we keep running the scripts, records get created so in the 2nd position maybe it is some other record so when edit is applied this record will popup for edition.
Can we give some other way like specifying the contact name for edition in the scripts.
Can we give some other way like specifying the contact name for edition in the scripts.
- sharathRegular Participant
- Posts : 29
Join date : 2012-08-04
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 6:51 pm
Please correct whether my understanding is right?
Yes when you add a contact you will have it as a first record.So obviously using xpath the previously first contact will come to second row and only that will get selected.So this is a dynamic table right. ???
If you want only the record which you created in the script, you can use the xpath by id.But if you delete this record you have to again script it , as the id of the new contact changes because of dynamic data.
Yes when you add a contact you will have it as a first record.So obviously using xpath the previously first contact will come to second row and only that will get selected.So this is a dynamic table right. ???
If you want only the record which you created in the script, you can use the xpath by id.But if you delete this record you have to again script it , as the id of the new contact changes because of dynamic data.
- Bindhu
- Posts : 5
Join date : 2012-09-12
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 7:23 pm
Your understanding is right, but here in the Xpath dropdown xpath by id is not there. This is not populating.
The contact are sorted in alphabetical order.
The contact are sorted in alphabetical order.
- sharathRegular Participant
- Posts : 29
Join date : 2012-08-04
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 7:36 pm
good then if that is the case , you can use Click command and in target use Link=Contactname
Hope this helps,
Sharath
Hope this helps,
Sharath
- Bindhu
- Posts : 5
Join date : 2012-09-12
Re: Issue related with the positioning of rows (X path) while executing selenium script
Wed Sep 12, 2012 7:54 pm
when you click on a particular entry, by default the Xpath is taken into consideration, so how can we change that to 'Click command and in target use Link=Contactname'. In the target dropdown only xpath is mentioned and not any name.
- sharathRegular Participant
- Posts : 29
Join date : 2012-08-04
Re: Issue related with the positioning of rows (X path) while executing selenium script
Thu Sep 13, 2012 10:37 am
Hi Bindhu you can manually enter it. Dont use dropdown in Target when you are not using xpath. Use dropdown only in command and check.
- Sponsored content
- In selenium web driver , while running the script ,after the browser(modal) message box is displayed and closed by selenium , the next button click statement is not executing
- When I run the selenium RC script, I am getting Failed to start new browser, Firefox 3 could not be found in the path!
- Selenium Script issue
- Issue while running selenium webdriver script through ssh
- Issue while recording a Test Script in Selenium IDE with Autocompletee Editable Drop-Down
Permissions in this forum:
You cannot reply to topics in this forum
|
|