Element present but not visible

184 views
Skip to first unread message

Nandhini D

unread,
Sep 17, 2018, 10:33:12 AM9/17/18
to NightwatchJs
Hi All,


Im facing a weird issue that I'm unable to click or setValue for few of the elements in the website.

 Assertion is passing for "elementPresent" and failing for "elementVisible". 


.verify.elementPresent('#company-text')
//.waitForElementVisible('#company-text', 2000).click('#company-text')
.clearValue('#company-text')
.setValue('#company-text', 'Hello')
.click('#save-button')

Could you give input to solve this issue. Appreciate your response.

Regards,
Nandhini

 

David Linse

unread,
Sep 17, 2018, 11:08:29 AM9/17/18
to nightw...@googlegroups.com
what about verifying/asserting the element is also visible before assmung and just setting a value.. ? 

regards

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/7545a00c-5b46-47c7-8980-1a13754f370b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nandhini Dakshinamurthy

unread,
Sep 18, 2018, 4:57:30 AM9/18/18
to NightwatchJs

Please find the below details on this issue.


* Before setting the value, if I check for the "elementPresent". Below is the output.

 ✔ Element <body> was visible after 48 milliseconds.
 ✔ Testing if element <#company-text> is present.

OK. 2 assertions passed. (16.876s)

* Before setting the value, if I "waitForElementVisible", then I get the below output.

 - Running the integration for loginapp (12.758s)
   Timed out while waiting for element <#company-text> to be visible for 2000 milliseconds.  - expected "visible" but got: "not visible"








On Monday, September 17, 2018 at 5:08:29 PM UTC+2, davidlinse wrote:
what about verifying/asserting the element is also visible before assmung and just setting a value.. ? 

regards
On Sep 17, 2018 4:33 PM, "Nandhini D" <dnand...@gmail.com> wrote:
Hi All,


Im facing a weird issue that I'm unable to click or setValue for few of the elements in the website.

 Assertion is passing for "elementPresent" and failing for "elementVisible". 


.verify.elementPresent('#company-text')
//.waitForElementVisible('#company-text', 2000).click('#company-text')
.clearValue('#company-text')
.setValue('#company-text', 'Hello')
.click('#save-button')

Could you give input to solve this issue. Appreciate your response.

Regards,
Nandhini

 

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

David Linse

unread,
Sep 18, 2018, 5:54:47 AM9/18/18
to nightw...@googlegroups.com
just because an element is present in the page, it does not mean it is visible. 
nightwatch behaves exactly this way. it can not click a button which is outside the screen.

thatswhy, assert if the element in question is visible.

regards.

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Nandhini D

unread,
Sep 18, 2018, 6:58:53 AM9/18/18
to NightwatchJs
Thanks for the response. 

I understand ! Do you have any work around for this ?

David Linse

unread,
Sep 18, 2018, 7:37:43 AM9/18/18
to nightw...@googlegroups.com
Do you, as a user in front of a browser, have you a workaround to click an element thats not on the screen ? 

there is no workaround.
make sure the element is visible before stupidly trying to set a value.. 

regards

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Nandhini D

unread,
Sep 18, 2018, 7:45:28 AM9/18/18
to NightwatchJs


Do you know that the element is not seen in browser ??? The element is on top of the page and its the first element in the page but it looks like the design is bit strange so its not visible in the testing.

If you can help others post some answers else you can ignore..

Never assess something on your own before replying others. 

Karen

unread,
Sep 18, 2018, 1:32:58 PM9/18/18
to NightwatchJs
I have run into the same issue a handful of times, there is no workaround but to get another element locator, try looking for another html tag such as <input>, usually works for me.

Simon Correia

unread,
Sep 19, 2018, 1:31:12 AM9/19/18
to nightw...@googlegroups.com
Hi Nandhini,

There are a lot of solutions for a lot of things. But can you try to explain what exactly are u trying to do? Any if any of the below is correct?

1. Are you trying to find an element, click on it and than set a value? As i can see you have commented that line of code.
2. Are you trying to find an element and directly set a value without any click?
3. Is the element below the screen fold? Meaning below the screen which fits in the browser? If this is the case than use .moveToElement() method.
4. Is there any element which appears before the element you are trying to assert?

.setValue() works for an element which has an input tag. For e.g an element like 'input#company-text'

If i could get a more clear picture of the html of that page than i might be able to help in a more better way.

Thanks & Regards,

Simon

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

Nandhini D

unread,
Sep 19, 2018, 5:31:52 AM9/19/18
to nightw...@googlegroups.com
Hi Karen and Simon,

Thank you so much for your input. 


Please find more details about the issue. 


Issue: A bit background about the page. The page has 5 menus on the left side and if we click on each menu some text fields can be seen on the right side of the page. In my script, Im clicking on the first menu(left side) and trying to click/setValue etc(on right side). 


Though the elements are seen in top of the page in browser, but as per the design these elements are not visible in the same page or its somewhere out of the page.


Below is the element tag:


<input type="text" name="entityname" input="[object Object]" meta="[object Object]" label="form.companyName" servererrortext="" id="company-text" value="" style="padding: 0px; position: relative; width: 100%; border: none; outline: none; background-color: rgba(0, 0, 0, 0); color: rgb(77, 77, 77); cursor: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 1rem; line-height: inherit; font-family: inherit; opacity: 1; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); height: 100%; box-sizing: border-box; margin-top: 14px;">


CSS path:


#company-text


Ps: The Front end is designed in Javascript in React framework. 


Appreciate your help. 



Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/7545a00c-5b46-47c7-8980-1a13754f370b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
Page.png

Simon Correia

unread,
Sep 19, 2018, 9:08:16 AM9/19/18
to nightw...@googlegroups.com
Okay great.

So after clicking the left menu can you do below?
1. Add .waitForElementVisible() for company name field and than .clearValue() and .setValue()
2. If above does not work than after clicking on left menu add .moveToElement() method and check
3. Last option is add .pause() than .assert or .verify the field.

Thanks & Regards,

Simon


Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/7545a00c-5b46-47c7-8980-1a13754f370b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Simon Correia

unread,
Sep 19, 2018, 9:09:53 AM9/19/18
to nightw...@googlegroups.com
Also did First Name and Last Names you were able to set?

Thanks & Regards,

Simon


Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/7545a00c-5b46-47c7-8980-1a13754f370b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Nandhini Dakshinamurthy

unread,
Sep 19, 2018, 10:38:56 AM9/19/18
to NightwatchJs

I was trying out with option 1 & 3 before. Now also I tried out with all the solutions once again. Unfortunately no luck :(.

Just to add on, the element seems to be hidden in the page. Im analysing further on this issue. 

Do you think that I need to discuss with developers for some input ?

I really liked the healthy discussion with you on this issue. Thanks for the support. 


Thanks & Regards,

Simon


Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/7545a00c-5b46-47c7-8980-1a13754f370b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Nandhini Dakshinamurthy

unread,
Sep 19, 2018, 10:44:50 AM9/19/18
to NightwatchJs
Just to add on.. Yes the Firstname, Lastname fields also are not working. 

On the whole, none of the text fields are visible in this page(I mean text fields inside all the menus). 

Simon Correia

unread,
Sep 20, 2018, 1:36:44 AM9/20/18
to nightw...@googlegroups.com
May be i could help even more if i could try it out. But looks like the page you are access will require log in and will be some project?
Neways its not difficult but there will be something you might be missing. Try adding more wait time when you use .waitForElementVisible() or try other methods from - http://nightwatchjs.org/api

Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.

Simon Correia

unread,
Sep 20, 2018, 1:38:11 AM9/20/18
to nightw...@googlegroups.com
What happens when you remove the mouse cursor off the right menu? Does it disappear? Or does it remain until you click somewhere else or on other menu?
I hope its a click even on left menu and not hover.

Thanks & Regards,

Simon

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.

To post to this group, send email to nightw...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages